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 ourterms of serviceand privacy statement.We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with typescript auto import from devDependencies #23842

Closed
Bombastickjopened this issue Oct 20, 2023 · 3 comments
Closed

Issue with typescript auto import from devDependencies #23842

Bombastickjopened this issue Oct 20, 2023 · 3 comments

Comments

@Bombastickj
Copy link

Environment

Nuxt project info: 01:01:00


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.8.0
  • CLI Version: 3.9.1
  • Nitro Version: 2.7.0
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools, typescript
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz /edit/github-mdasny?file=app.vue

Describe the bug

It seems like nuxt v3.8.0 is not auto importing devDependencies correctly. I am using the google maps api and typescript throws an error that 'google' is not defined. Worked until v3.7.4

Additional context

No response

Logs

No response

@stackblitz
Copy link

stackblitz bot commented Oct 20, 2023

Fix this issue in StackBlitz CodeflowStart a new pull request inStackBlitz Codeflow.

@warflash
Copy link
Member

warflash commented Oct 20, 2023

Thanks, that sounds similar to#23733but not entirely sure so perhaps we could track there in the future if related

@warflash warflash added the types label Oct 20, 2023
@danielroe danielroe removed the 3.x label Jun 30, 2024
@danielroe
Copy link
Member

Nuxt automatically setscompilerOptions.typesto an empty array for performance - so TypeScript won't scan your dependencies for types at all. If you have specific types you want included, just set this in yournuxt.config:

exportdefaultdefineNuxtConfig({
typescript:{
tsConfig:{
compilerOptions:{
types:['@types/google.maps']
}
},
},
});

@danielroe danielroe closed this asnot planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
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