WARN [nuxt] Two component files resolving

953 views Asked by At

WARN [nuxt] Two component files resolving to the same name ProseCode:

  • ./node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProseCode.vue
  • ./node_modules/@nuxt/content/dist/runtime/components/Prose/ProseCode.vue

WARN [nuxt] Two component files resolving to the same name ProsePre:

  • ./node_modules/@nuxtjs/mdc/dist/runtime/components/prose/ProsePre.vue
  • ./node_modules/@nuxt/content/dist/runtime/components/Prose/ProsePre.vue

warning after updated nuxt 3 -> 3.7 & nuxt/content 2.4 -> 2.8

how can this be fixed? thanks

4

There are 4 answers

0
patbird On BEST ANSWER

As stated in https://github.com/nuxt/content/issues/2266#issuecomment-1720124274

There are no warnings logged with Content v2.8.2 and Nuxt v3.7.2 anymore.

So just upgrade to:

  • nuxt/content >= 2.8.2 and
  • nuxt >= 3.7.2

Make sure to run the following command afterwards

npx nuxi upgrade --force

It'll delete your lockfile and node_modules folder to make sure you'll get the new versions.

0
hashem shafai On

you shouldn't use two same component names with the same address, warning here that you've done it twice.

0
Nico Kempe On

That is likely related to this issue: https://github.com/nuxt/content/issues/2266 Nuxt typecheck is broken with nuxt/[email protected] )

0
Sam Carrington On

This issue is tracked in the nuxt github at https://github.com/nuxt/content/issues/2266

I'm seeing it too so am watching for updates!

edit: Looks like its fixed at [email protected] and upward, I'm no longer seeing it in my build