Skip to content

estree-walker v3 breaks build #25

Closed

Description

@CodeDredd

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 😄

Activity

  1. added a commit that references this issue on Aug 4, 2022
    a493ea9
  2. pi0 commented on Aug 4, 2022

    @pi0
    Member

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

  3. CodeDredd commented on Aug 4, 2022

    @CodeDredd
    Author

    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.

  4. pi0 commented on Aug 4, 2022

    @pi0
    Member

    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
    
  5. CodeDredd commented on Aug 4, 2022

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

  6. pi0 commented on Aug 4, 2022

    @pi0
    Member

    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!

  7. JenuelDev commented on Jun 9, 2023

    @JenuelDev

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions