#Could not load @nuxtjs/sitemap. Is it installed?
1 messages · Page 1 of 1 (latest)
Hi @muted wraith. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the information provided in the knowledge sources, it appears that you're encountering an issue with the @nuxtjs/sitemap module in a Nuxt 3 project. The error you're seeing suggests that the module is not properly installed or configured. Here's what you need to know:
-
Version Compatibility: The @nuxtjs/sitemap module version 2.x is specifically for Nuxt 2. For Nuxt 3, you need to use a different module.
-
Nuxt 3 Solution: For Nuxt 3, it's recommended to use the nuxt-simple-sitemap module instead of @nuxtjs/sitemap.
To resolve this issue, follow these steps:
-
Uninstall the @nuxtjs/sitemap module:
npm uninstall @nuxtjs/sitemap -
Install the nuxt-simple-sitemap module:
npm install nuxt-simple-sitemap -
Update your
nuxt.config.tsfile to use the new module:export default defineNuxtConfig({ modules: [ 'nuxt-simple-sitemap' ], // ... other configurations }) -
Configure the sitemap as needed according to the nuxt-simple-sitemap documentation.
By making these changes, you should be able to generate a sitemap in your Nuxt 3 project without encountering the "Could not load @nuxtjs/sitemap" error.
For more detailed information on using sitemaps with Nuxt 3, you can refer to the Stack Overflow post which discusses this issue.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@muted wraith Kapa.ai is still learning and improving, please let me know how I did by reacting below.
I'm having the same issue, and other people have reported this too.
It was flagged as fixed yesterday #1330449872461103175 message but I don't think it is?
The issue is clearly not fixed, I have the latest version
I believe this was the source of the error.
If you still have issues please confirm you're using the latest version (nuxi upgrade --force can help) and open an issue if it's still throwing an error