Type Support with Webstorm / PhpStorm
See original GitHub issueEnvironment
PhpStorm 2021.3
- Operating System:
Linux
- Node Version:
v16.11.1
- Nuxt Version:
3.0.0-27313139.1c88580
- Package Manager:
yarn@1.22.15
- Bundler:
Vite
- User Config:
windicss
,buildModules
- Runtime Modules:
-
- Build Modules:
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
- Modify nuxt.config.ts
import { defineNuxtConfig } from 'nuxt3'
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
windicss: {
},
buildModules: [
'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.
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.nuxt" />
</content>
<content url="file://$MODULE_DIR$/.nuxt" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top GitHub Comments
Nuxt 3 support rolling out in EAP build: https://blog.jetbrains.com/webstorm/category/eap/
See https://twitter.com/PiotrekTomiak/status/1487105766024695819.
The thread can be closed: these issues will be fixed in next Webstorm EAP. See: https://youtrack.jetbrains.com/issue/WEB-56392/Nuxt-3-functions-exposed-in-importsdts-file-are-suggested-to-be-imported