estree-walker v3 breaks build
See original GitHub issueError
Cannot start nuxt: No “exports” main defined in /home/dredd/PhpstormProjects/codedredd/pinia-orm/docs/node_modules/nuxt/node_modules/estree-walker/package.json 13:42:34
at new NodeError (node:internal/errors:371:5) at throwExportsNotFound (node:internal/modules/esm/resolve:440:9) at packageExportsResolve (node:internal/modules/esm/resolve:645:7) at resolveExports (node:internal/modules/cjs/loader:482:36) at Function.Module._findPath (node:internal/modules/cjs/loader:522:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27) at Function.resolve (node:internal/modules/cjs/helpers:108:19) at _resolve (node_modules/jiti/dist/jiti.js:1:108226) at jiti (node_modules/jiti/dist/jiti.js:1:110413) at node_modules/nuxt/node_modules/unctx/dist/transform.cjs:7:22
Reason
The reason is simple. As the error displays since v3 of estree-walker the “main” in package.json
was removed
See -> https://github.com/Rich-Harris/estree-walker/commit/f7e336f94290fd4b72cbc033922d606f1e27d8b9
A PR to fix this already exists but is till now not merged: https://github.com/Rich-Harris/estree-walker/pull/29
Reproduction
https://stackblitz.com/edit/nuxt-starter-vsshdr?file=package.json
Solution (Hot fix)
Move back to v2
PR incoming 😄
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Thanks @pi0 . Yeah looked already on your PR for nuxt/framework. I already was confused why native esm was not supported 😆 . So it seems i still have to find another thing to get my first PR to nuxt, vue, unjs,^^
Still working on framework to trace what places need proper esm import with jiti. In the meantime, please remove lockfile and node_modules and start dev with: