Nuxt@2.15.0 component prefix changes

Some of the custom components (with auto-import feature enabled) are no longer found and the standard message is thrown:
Unknown custom element: <LanguageSwitcher> - did you register the component correctly?.

What I found is that <language-switcher> works, whether the syntax I used before 2.15.0 (<LanguageSwitcher>) doesn’t, as from what I noticed it most likely resolves to <languageswitcher>.

1 possible answer(s) on “Nuxt@2.15.0 component prefix changes

  1. Thanks for sharing @DamianGlowala. If you notice in generated file, component name is changed to PagesIndexLanguageSwitcher since with 2.15, we use full-path to prefix component names (components/pages/index/LanguageSwitcher.vue => PagesIndexLanguageSwitcher ). This is to avoid two components with same name conflicting. You need to either use new name or update nuxt.config as below to explicitly allow old behavior:

    // nuxt.config.js
    export default {
      components: [
        '~/components',
       '~/components/pages/index`
      ]
    }