Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

nuxt.config.ts sitemap key Typescript error in VSCode #22

Open
AlejandroMut opened this issue Jan 2, 2023 · 2 comments
Open

nuxt.config.ts sitemap key Typescript error in VSCode #22

AlejandroMut opened this issue Jan 2, 2023 · 2 comments

Comments

@AlejandroMut
Copy link

VSCode does not recognize the sitemap key and keeps highlighting it within the nuxt.config.ts file.

rsz_1screenshot_2023-01-02_143313

Full error:

Argument of type '{ css: string[]; app: { head: { htmlAttrs: { lang: string; }; link: { rel: "preload"; as: "style"; onload: string; href: string; media: string; }[]; script: { hid: string; src: string; defer: true; }[]; }; }; routeRules: { ...; }; ... 5 more ...; sitemap: { ...; }; }' is not assignable to parameter of type 'NuxtConfig'.
  Object literal may only specify known properties, and 'sitemap' does not exist in type 'NuxtConfig'.ts(2345)
@eggnstone
Copy link

eggnstone commented Jan 26, 2023

I think sitemap is the old nuxt2 way.
Try putting it in the modules part:

export default defineNuxtConfig({     
        modules:
            [
                [
                    "@funken-studio/sitemap-nuxt-3",
                    {
                        hostname: "https://example.com"
                    }
                ]                
            ]
    }
);

This worked for me with nuxt 3.0.0.
With the current nuxt version 3.1.1 I have a different problem, see #29.

@eggnstone
Copy link

Also see #21.

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

No branches or pull requests

2 participants