harlan-zw / nuxt-seo

The complete SEO solution for Nuxt.
https://nuxtseo.com
1.02k stars 62 forks source link

RollupError when having sitemap enabled and robots disabled #270

Closed RobArkesteijn closed 1 month ago

RobArkesteijn commented 1 month ago

Describe the bug

I noticed that when using nuxt/seo (version 2.0.0-rc12 in my case) you get a rollup error when disabling robots while still having sitemap enabled. I would not know of a use case where you dont want to combine them, but it would perhaps be good to specify it in the documentation that you need have robots enabled when using sitemap.

`[nitro 20:26:57]  ERROR  RollupError: node_modules/@nuxtjs/sitemap/dist/runtime/nitro/sitemap/urlset/filter.js (3:9): "getPathRobotConfig" is not exported by "virtual:#imports", imported by "node_modules/@nuxtjs/sitemap/dist/runtime/nitro/sitemap/urlset/filter.js".

1: import { parseURL } from "ufo";
2: import { createFilter } from "../../../utils-pure.js";
3: import { getPathRobotConfig } from "#imports";
            ^
4: export function filterSitemapUrls(_urls, options) {
5:   const urlFilter = createFilter({`

Reproduction

No response

System / Nuxt Info

No response

harlan-zw commented 1 month ago

Thanks, this will be supported in the next Nuxt SEO release. When a module is disabled we add a mock version of it so you can safely disable any module without breaking any composable usages.

harlan-zw commented 1 month ago

This should be solved with the @nuxtjs/robots v4 release.