Closed anburocky3 closed 1 year ago
try adding a vite-env.d.ts
inside your src folder adding this (if you're NOT using vue, configure the corresponding fw):
/// <reference types="unplugin-icons/types/vue" />
if not working try adding this to your tsconfig.json
:
"compilerOptions": {
"types": ["unplugin-icons/types/vue"]
}
I have already added the types in the tsconfig.json
file.
I'm using Laravel with Vite, Where should i place the file vite-env.d.ts
?
I placed in root
as well as resources/js/
both, didn't pick up that, same issue.
what's the content of your tsconfig.json file?
EDIT: just add the include entry and set it where you want...
These are my tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "es2020",
"moduleResolution": "node",
"strict": true,
// Enable strict type-checking options
"skipLibCheck": true,
// Skip type checking of declaration files
"noImplicitAny": false,
// Bypass raising errors on `any` type
"baseUrl": ".",
"paths": {
"@/*": [
"./resources/js/*"
],
"ziggy": [
"vendor/tightenco/ziggy/dist/vue"
]
},
"types": [
"vite/client",
"node",
"unplugin-icons/types/vue"
]
},
"include": [
"resources/assets",
"resources/js/**/*"
]
// Frontend paths pattern
}
I think, the error which i showed before, is coming from PHPStorm and not typescript.
try adding the dts file inside resources folder and add "resources/**.d.ts" to the include entry.
have you configured TS in the IDE (IntelliJ screenshot)?
upps, I'll upload another screenshot
For example, Vue3 example resolving, but the react one missing (in both cases the IDE will go to the definition):
This is what i did:
vite-env.d.ts
inside resources
directory with the following code.
/// <reference types="unplugin-icons/types/vue" />
tsconfig.json
file
"include": [
"resources/assets",
"resources/js/**/*",
+ "resources/**.d.ts"
]
After all this, still:
You can refer to this issues #213
Thank you and it fixed the errors. Thank you.
How to suppress or get rid of these IDE errors?
Adding docs on that, in the readme, would be super helpful.