#1975·elysia

Unexpected error: no match for module: exact-mirror.

Author: Atticus6Created Aug 23, 2026Updated Aug 24, 2026
Labelsbug

What version of Elysia is running?

├── @cloudflare/[email protected] ├── [email protected] ├── [email protected] └── [email protected]

What platform is your computer?

Darwin 23.6.0 arm64 arm

What environment are you using

❯ bun -v 1.3.14

Are you using dynamic mode?

false

What steps can reproduce the bug?

error

bash
❯ bun dev  
$ vite
19:13:55 [vite] (test) Re-optimizing dependencies because lockfile has changed
AssertionError [ERR_ASSERTION]: Unexpected error: no match for module: exact-mirror.
    at Object.unsafeModuleFallbackService (file:///Users/atticus/projects/test/node_modules/@cloudflare/vite-plugin/dist/index.mjs:127676:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async #handleLoopback (/Users/atticus/projects/test/node_modules/miniflare/dist/src/index.js:112176:20)
Fallback service failed to fetch module; payload = AssertionError [ERR_ASSERTION]: Unexpected error: no match for module: exact-mirror.
    at Object.unsafeModuleFallbackService (file:///Users/atticus/projects/test/node_modules/@cloudflare/vite-plugin/dist/index.mjs:127676:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async #handleLoopback (/Users/atticus/projects/test/node_modules/miniflare/dist/src/index.js:112176:20); spec = /?specifier=%2FUsers%2Fatticus%2Fprojects%2Ftest%2Fnode_modules%2F.vite%2Fdeps_test%2Fexact-mirror&referrer=%2FUsers%2Fatticus%2Fprojects%2Ftest%2Fnode_modules%2F.vite%2Fdeps_test%2Felysia.js&rawSpecifier=exact-mirror
19:13:56 [vite] (client) Re-optimizing dependencies because lockfile has changed

  VITE v8.2.2  ready in 2235 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  Debug:   http://localhost:5173/__debug
  ➜  press b + enter to list configured Cloudflare bindings
  ➜  press e + enter to open local explorer
  ➜  press t + enter to start tunnel
  ➜  press h + enter to show help
^Cerror: script "dev" exited with code 130

src/index.ts

typescript
import { Elysia } from "elysia";
import { z } from "zod";

const app = new Elysia().get(
  "/test",
  {
    query: z.object({ name: z.string() }),
  },
  (ctx) => ctx.query,
);

export default app;

vite.config.ts

typescript
import { cloudflare } from "@cloudflare/vite-plugin";
import { aot } from "elysia/plugin/aot/vite";

import { defineConfig } from "vite";
export default defineConfig({
	plugins: [
		aot("src/index.ts", { target: "workerd", production: false, treeShake: false }),
		cloudflare(),
	],
});

wrangler.json

json
{
   "$schema": "node_modules/wrangler/config-schema.json",
   "main": "src/index.ts",
   "compatibility_date": "2026-08-24"
}

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

Have you try removing the node_modules and bun.lock and try again yet?

yes