Closed cyrilf closed 1 week ago
Thanks for raising this, it seems like an upstream bug in Nuxt. I've set up a graceful fallback if the version read fails.
Nice, thanks for the quick answer and fix! đ Do you think I need to raise an issue on the Nuxt repo or is this one solving it already?
Yes that should do the trick!
đ The bug
When I build my Nuxt project the following error occurs:
[@nuxtjs/sitemap 9:35:41 AM] WARN You are using @nuxtjs/robots vfalse. For the best compatibility, please upgrade to @nuxtjs/robots v4.0.0 or higher.
resulting further down in the build to:
Duplicated imports "getPathRobotConfig", the one from "/home/x/dev-project/node_modules/@nuxtjs/sitemap/dist/runtime/nitro/composables/getPathRobotConfigPolyfill" has been ignored and "/home/x/dev-project/node_modules/@nuxtjs/robots/dist/runtime/nitro/composables/getPathRobotConfig.js" is used
Reproduction
Use the reproduction link below and watch the console. The warning messages are incorrectly displayed but by selecting the text in the console, you can read them entirely.
OR
Create a new Nuxt project:
npx nuxi@latest init test-seo
Then go in this project
cd test-seo
Then install
nuxt-seo
npx nuxi module add @nuxtjs/seo
Then run a build:
npm run build
You will see the error messages mentioned earlier.
Context
The error seems to occur in that hook which is calling this function
Maybe related to this older issue
đ ī¸ To reproduce
https://stackblitz.com/edit/nuxt-starter-vtmy8d?file=package.json
đ Expected behavior
The sitemap module should correctly find my
nuxtjs/robots
version and I see no error or warning in the console.âšī¸ Additional context
These are the dependencies:
I'm using
npm
version:10.2.4
andnode
versionv20.11.0
Maybe fixed by https://github.com/nuxt/nuxt/pull/29793 ? đ¤