I am trying to deploy the hono example project with nested routes but I keep getting the error below
ReferenceError: exports is not defined in ES module scope
it runs fine locally
Looks like this issue reported here from march hasn't been resolved
https://github.com/orgs/vercel/discussions/6252
I've tested a 2x2x2x2 matrix of factors — JS vs TS, Edge vs Node runtime, dev vs prod, and package.json type: module vs not — and here are the results:
| Lang | Runtime | type:module | Dev | Prod |
|---|---|---|---|---|
| JS | Edge | type:module | ✅ | ✅ |
| JS | Edge | – | ✅ | ✅ |
| JS | Node | type:module | ✅ | ✅ |
| JS | Node | — | ✅ | ✅ |
| TS | Edge | type:module | ✅ | ✅ |
| TS | Edge | — | ✅ | ✅ |
| TS | Node | type:module | ✅ | ❌ |
| TS | Node | — | ❌ | ✅ |
Error details:
- TS/Node/type:module/prod:
ReferenceError: exports is not defined in ES module scope - TS/Node/—/dev:
Error: Unexpected token 'export'