Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start nuxt: Cannot read properties of undefined (reading 'etag') #274

Closed
retroriff opened this issue Nov 6, 2022 · 4 comments
Closed

Comments

@retroriff
Copy link

I am getting this error on Nuxt3 after adding the sitemap module to the config file:

"@nuxtjs/sitemap": "^2.4.0",
"nuxt": "3.0.0-rc.13",
ERROR  Cannot start nuxt:  Cannot read properties of undefined (reading 'etag')                     17:41:11

  at setDefaultSitemapOptions (node_modules/@nuxtjs/sitemap/lib/options.js:26:39)
  at registerSitemap (node_modules/@nuxtjs/sitemap/lib/middleware.js:48:13)
  at registerSitemaps (node_modules/@nuxtjs/sitemap/lib/middleware.js:32:5)
  at node_modules/@nuxtjs/sitemap/lib/module.js:50:5
  at Array.forEach (<anonymous>)
  at Object.module (node_modules/@nuxtjs/sitemap/lib/module.js:49:11)
  at async installModule (node_modules/@nuxt/kit/dist/index.mjs:427:3)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:1787:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6839:5)
@michaelpumo
Copy link

Try this in your Nuxt config for now:

render: {
  etag: {
    weak: false
  }
}

@retroriff
Copy link
Author

retroriff commented Nov 8, 2022

Thanks, this setting fixes the error. But now it generates a different error when I add i18n: true:

Cannot restart nuxt:  Cannot convert undefined or null to object at
at Function.keys (<anonymous>)
at setDefaultSitemapOptions (node_modules/@nuxtjs/sitemap/lib/options.js:44:28)
at registerSitemap (node_modules/@nuxtjs/sitemap/lib/middleware.js:48:13)
at registerSitemaps (node_modules/@nuxtjs/sitemap/lib/middleware.js:32:5)
at node_modules/@nuxtjs/sitemap/lib/module.js:50:5
at Array.forEach (<anonymous>)
at Object.module (node_modules/@nuxtjs/sitemap/lib/module.js:49:11)
at async installModule (node_modules/@nuxt/kit/dist/index.mjs:427:3)
at async initNuxt (node_modules/nuxt/dist/index.mjs:1787:7)
at async load (node_modules/nuxi/dist/chunks/dev.mjs:6778:9)
at async _applyPromised (node_modules/nuxi/dist/chunks/dev.mjs:6712:10)

When I remove i18n: true there's no error but the sitemap returns a 404.

@kilobyte2007
Copy link

@retroriff I don't think this module is compatible with Nuxt 3. See this repo for the current solution - https://github.com/benoitdemaegdt/nuxt3-sitemap

@d3xter-dev
Copy link

Check https://www.npmjs.com/package/@funken-studio/sitemap-nuxt-3 for a version which works with Nuxt 3 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants