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 find module from node_modules #26955

Closed
ps-20x opened this issue Apr 26, 2024 · 4 comments
Closed

Cannot find module from node_modules #26955

ps-20x opened this issue Apr 26, 2024 · 4 comments

Comments

@ps-20x
Copy link

ps-20x commented Apr 26, 2024

Environment

  • Operating System: Darwin
  • Node Version: v18.20.2
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.5.0
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Checkout https://github.com/ps-20x/phpstorm-issues
  2. Run npm ci
  3. Open utils/createSitemapItem.ts
  4. Import type shows an error

Describe the bug

The following error is showing up:

Vue: Cannot find module @nuxtjs/sitemap/dist/runtime/types or its corresponding type declarations.

Additional context

Tried it in PHPStorm as well as in VSCode. The project is an almost plain project.

PHPStorm
image

VSCode
image

Logs

No response

Copy link
Member

This is an issue with the types in @nuxtjs/sitemap, not with Nuxt. Would you raise an issue there instead?

https://arethetypeswrong.github.io/?p=@nuxtjs/sitemap@5.1.4

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
@ps-20x
Copy link
Author

ps-20x commented Apr 29, 2024

This is an issue with the types in @nuxtjs/sitemap, not with Nuxt. Would you raise an issue there instead?

https://arethetypeswrong.github.io/?p=@nuxtjs/sitemap@5.1.4

Thank you very much for getting back to me. I raised an issue in @nuxtjs/sitemap and linked it for reference.

@harlan-zw
Copy link
Contributor

harlan-zw commented Apr 29, 2024

This is an issue with the types in @nuxtjs/sitemap, not with Nuxt. Would you raise an issue there instead?

arethetypeswrong.github.io/?p=@nuxtjs/sitemap@5.1.4

FYI these type issues are within all Nuxt modules so this is not relevant, see https://arethetypeswrong.github.io/?p=%40nuxt%2Ffonts%400.6.1

Will resolve provide further details on the new issue

Copy link
Member

danielroe commented Apr 29, 2024

It's a question for module authors, as to how they want to expose their types. Your answer in the linked issue is correct - if you want users to be able to import from ./dist subpath this needs to be added to exports as a subpath export pattern.

I don't believe there's any bug here in the module builder.

(And also, it seems there isn't a bug in nuxtjs/sitemap either!)

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

No branches or pull requests

3 participants