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

node 14.1 is broken #191

Closed
adamberecz opened this issue Apr 28, 2021 · 9 comments
Closed

node 14.1 is broken #191

adamberecz opened this issue Apr 28, 2021 · 9 comments

Comments

@adamberecz
Copy link

adamberecz commented Apr 28, 2021

Describe the bug
Components are no longer auto imported.

To Reproduce
Try with a fresh install, you'll get Unknown custom element: <Logo> error. I tried multiple times with new installs it's the same for the last couple of hours. Probably related to the new patch.

Expected behavior
The components should be auto imported from /components when components: true in nuxt.config.js.

@adamberecz
Copy link
Author

adamberecz commented Apr 28, 2021

I can confirm that downgrading @nuxt/components to 2.1.6 solves the problem.

Here's a quickfix that should be put into npm-shrinkwrap.json next to package.json then run npm i:

{
  "dependencies": {
    "nuxt": {
      "version": "2.15.4",
      "from": "nuxt@2.15.4",
      "dependencies": {
        "@nuxt/components": {
          "version": "2.1.6",
          "from": "@nuxt/components@^2.1.4"
        }
      }
    }
  }
}

@pi0
Copy link
Member

pi0 commented Apr 28, 2021

Naming resolution is changed with full prefix. Check migration guide: https://github.com/nuxt/components#migration-guide

You can also check CLI output for hint to generated component names :)

(downgrading is neither adviced or a solution)

@adamberecz
Copy link
Author

adamberecz commented Apr 28, 2021

This has nothing to do with prefixing. The issue occurs in a completely fresh Nuxt install for the last couple of hours.

@pi0
Copy link
Member

pi0 commented Apr 28, 2021

Would you please help to reproduce by forking this sandbox? https://codesandbox.io/s/ley4h (it is fresh from latest versions)

@adamberecz
Copy link
Author

adamberecz commented Apr 28, 2021

Would you please help to reproduce by forking this sandbox? https://codesandbox.io/s/ley4h (it is fresh from latest versions)

That should be it (just a plain fresh install) but this does not reproduce the error in the sandbox.

Reproduction is as simple as installing a fresh nuxt with:

Project name: nuxt-test
? Programming language: JavaScript
? Package manager: Npm
? UI framework: None
? Nuxt.js modules: 
? Linting tools: (Press <space> to select, <a> to toggle all, <i> to invert sele
ction)
? Testing framework: None
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Static (Static/Jamstack hosting)
? Development tools: jsconfig.json (Recommended for VS Code if you're not using 
typescript)
? What is your GitHub username? -
? Version control system: Git

Then run npm run dev. Let me know if you need more details, but that's really all I do. It did work in the morning, but not anymore. I'm on Mac.

@pi0
Copy link
Member

pi0 commented Apr 28, 2021

Can you please check your npm and node.js version?

@adamberecz
Copy link
Author

npm: 6.14.4
node.js: 14.1.0

@pi0 pi0 changed the title Auto import stopped working node 14.1 is broken Apr 28, 2021
@pi0
Copy link
Member

pi0 commented Apr 28, 2021

Thanks. I can confirm now:

  • Working: 14.16.1
  • Not working: 14.1.0

(Issue can be fixed by upgrading to latest LTS but also new fresh installs with 14.1 will work again)


Trace: #189 /cc @danielroe

Debugging why module not discovered with getPkg:

@nuxt/components/package.json Package subpath './package.json' is not defined by "exports" in .../node_modules/@nuxt/components/package.json

@pi0 pi0 closed this as completed in 5949790 Apr 28, 2021
@ingwinlu
Copy link

ingwinlu commented Apr 29, 2021

Running node v14.16.1 here, neither v2.1.7 nor v2.1.8 is picking up NEW components I am adding to my existing project (older
previously existing components are found and loaded fine).
I now reverted the update commit and reinstalled node modules (so back on v2.1.6) and new components are picked up again.

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

No branches or pull requests

3 participants