components: Since updating from Nuxt 2.15.4 to 2.15.8, auto import components no longer work

Nuxt version 2.15.8

Describe the bug

All my components are saved to the root of the components directory - so no potential issue with missing prefixes there. When I try and add a component into my pages, for example…

/components/CookieConsent.vue

/layouts/defaut.vue:
<template>
  <div class="app">
  	<main class="main">
		    <Nuxt />
		</main>
	<cookie-consent :decline-allowed="false" position="bottom-left"/>
  </div>
</template>

...i get the following error:

Unknown custom element: <cookie-consent> - did you register the component correctly? For recursive components, make sure to provide the “name” option.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I’ve got it working 🎉. .

  1. I removed node and NPM
  2. Re-installed latest stable release (was on v13, now on v16)
  3. deleted the entire repo
  4. Re-installed packages
  5. Ran npm audit fix

and now it works. No idea why

Thanks for your help. Shame I can’t help anyone else figure it out any more specifically though, as it seems like whatever it is, is happening to lots of people.

same issue nuxt: 2.15.8 nuxt/component: 2.1.8

I have the same issue: nuxt: 2.15.8 nuxt/component: 2.1.8

I’ve the same issue as described in the bug description with:

nuxt: v2.15.8 nuxt/components: v2.2.1

I’m seeing the same thing with a fresh install and fresh yarn.lock. Any thoughts? It installs @nuxt/component version 2.1.8.

Excerpt from `package.json’:

  "dependencies": {
    "bootstrap-vue": "^2.21.2",
    "nuxt": "^2.15.8"
  }
yarn install v1.22.11
info No lockfile found.
[1/4] Resolving packages...
warning bootstrap-vue > popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
warning nuxt > @nuxt/babel-preset-app > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning nuxt > @nuxt/webpack > webpack-hot-middleware > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning nuxt > @nuxt/webpack > webpack > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning nuxt > @nuxt/webpack > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning nuxt > @nuxt/webpack > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning nuxt > @nuxt/webpack > postcss-preset-env > postcss-color-gray > postcss-values-parser > flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
warning nuxt > @nuxt/webpack > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning nuxt > @nuxt/webpack > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "bootstrap-vue > bootstrap@4.6.0" has unmet peer dependency "jquery@1.9.1 - 3".
warning "bootstrap-vue > portal-vue@2.1.7" has unmet peer dependency "vue@^2.5.18".
warning "nuxt > @nuxt/components@2.2.1" has unmet peer dependency "consola@*".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 15.97s.