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
Type issue when importing module #274
Comments
Please follow the docs and use the util function to extract the types, see https://nuxtseo.com/sitemap/guides/dynamic-urls#_2-create-your-own-endpoint createSitemapItem = function() {
return asSitemapUrl({ ... }) // types will just work
} Type support via dist runtime is not supported from the nuxt-module-builder currently afaik. There is a work around for this but the sitemap module has not implemented it yet. |
Thanks for your suggestion and help. This worked for my // works
type SitemapUrl = ReturnType<typeof asSitemapUrl>;
// does not work
type Priority = SitemapUrl["priority"];
type Changefreq = SitemapUrl['changefreq']; I am getting the message:
|
I've pushed up some improvements in v5.1.5 for the types. An alias is now added that points to the runtime types directly, it's at import type { SitemapUrl } from '#sitemap' Let me know if you have any issues. |
Worked perfectly thank you 🙇 |
Environment
Darwin
v18.20.2
3.11.2
3.11.1
2.9.6
npm@10.5.0
-
devtools
-
-
Reproduction
npm ci
Describe the bug
The following error is showing up:
Additional context
Tried it in PHPStorm as well as in VSCode. The project is an almost plain project.
PHPStorm
VSCode
You can check out more information on the type issues here: https://arethetypeswrong.github.io/?p=@nuxtjs/sitemap@5.1.4 (thanks to @danielroe)
This issue was initially raised in the nuxt repository: nuxt/nuxt#26955
The text was updated successfully, but these errors were encountered: