-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 Support with Webstorm / PhpStorm #13007
Comments
This is mentioned in the buildDir section for the |
Thanks for the link @viii47 good that it's covered in the doc somewhere. I did assume there was a way to change it. The resolution to this issue should be shipping a nuxt v3 where the end-user doesn't need to mess around with build dirs, types should just work. We're talking about ~25% of people getting stuck on this issue when setting up Nuxt (according to the State of JS 2020). Ideally the A solution that fixes some of the types having the config is this: {
// https://v3.nuxtjs.org/concepts/typescript
"extends": "./.nuxt/tsconfig.json",
"include": [
"**/*.d.ts"
],
} Seems relatively safe but I'm probably overlooking something |
TLDR: |
Nuxt 3 support rolling out in EAP build: https://blog.jetbrains.com/webstorm/category/eap/ See https://twitter.com/PiotrekTomiak/status/1487105766024695819. |
The point is in the types of generated Components Discovery. They extend vue GlobalComponents WebStorm expects them from @vue/runtime-core GlobalComponents. The following type definition should help:
But it would be better to fix the extend in Components Discovery. (.nuxt/components.d.ts) |
The thread can be closed: these issues will be fixed in next Webstorm EAP. |
Environment
PhpStorm 2021.3
Linux
v16.11.1
3.0.0-27313139.1c88580
yarn@1.22.15
Vite
windicss
,buildModules
-
nuxt-windicss@2.1.1
Reproduction
Follow steps here: https://v3.nuxtjs.org/getting-started/installation
Optionally to test this with a third-party module, do:
yarn add nuxt-windicss
Describe the bug
When booting Nuxt v3 the
.nuxt
folder is correctly created, however, PhpStorm (and presumably WebStorm) determine the.nuxt
folder to be a content root that should be excluded automatically. I'm not exactly sure what logic they've used to determine this, but possibly because it's a dot folder.Due to this, when working on the project, the "magic imports" of the typescript definitions fail, leaving the user confused and with errors.
This is also an issue for third-party modules
This can be easily resolved by cancelling the exclusion (right-click -> Mark directory as -> Cancel Exclusion), for the onboarding of new users there should be either some documentation for this or a way to not have to do this at all.
Additional context
While I'm fairly sure this isn't some special configuration or plugin in my PhpStorm/Webstorm creating this problem, it would be good to get confirmation from someone else who uses it.
Logs
No response
The text was updated successfully, but these errors were encountered: