Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

estree-walker v3 breaks build #25

Closed
CodeDredd opened this issue Aug 4, 2022 · 6 comments
Closed

estree-walker v3 breaks build #25

CodeDredd opened this issue Aug 4, 2022 · 6 comments

Comments

@CodeDredd
Copy link

CodeDredd commented Aug 4, 2022

Error

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 -> Rich-Harris/estree-walker@f7e336f

A PR to fix this already exists but is till now not merged: Rich-Harris/estree-walker#29

Reproduction

https://stackblitz.com/edit/nuxt-starter-vsshdr?file=package.json

Solution (Hot fix)

Move back to v2

PR incoming 😄

CodeDredd added a commit to CodeDredd/unctx that referenced this issue Aug 4, 2022
@pi0
Copy link
Member

pi0 commented Aug 4, 2022

Hi @CodeDredd. What version of Nuxt3 are you using? Do you mind to provide a reproduction please? 🙏🏼

@CodeDredd
Copy link
Author

CodeDredd commented Aug 4, 2022

Hey @pi0 sure. Sorry for not posting it right aways 😄 . I was using the latest edge version.
https://stackblitz.com/edit/nuxt-starter-vsshdr?file=package.json

I know my solution is the easy one....since estree-walker dropped commonjs support with removing "main". Somehow jiti is not able to handle this correctly.

@pi0
Copy link
Member

pi0 commented Aug 4, 2022

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:

JITI_ESM_RESOLVE=1 npm run dev

@CodeDredd
Copy link
Author

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,^^

@pi0
Copy link
Member

pi0 commented Aug 4, 2022

Okay last missing part was nuxt configuration loader (unjs/c12) to support esm resolution. Updating lockfile again should solve issues.

So it seems i still have to find another thing to get my first PR to nuxt, vue, unjs,^^

Absolutely! Looking forward to your next PR!

@pi0 pi0 closed this as completed Aug 4, 2022
@JenuelDev
Copy link

I am having this issue also,, just did an nxp nuxi upgrdae --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants