-
Notifications
You must be signed in to change notification settings - Fork 27
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 type definition file #20
Comments
Can you provide a reproduction? |
sorry for the vague description, create a sample repo |
If I remove the types
from the tsconfig.json it is working as expected. |
I have the same issue. @ravirambles : Your fix (temporary) works. So I removed "node", "mocha", "chai" from my tsconfig file. |
I've also gotten around this issue by referencing the types' /// <reference path="../../../../../node_modules/@types/node/index.d.ts" /> Which is of course not a great option. It would seem like the type resolution isn't working at all for that. You may additionally get around it by referencing them in a single |
Testing other options, I seem to find that it doesn't always fail, as if it may be something to do with incorrect relative paths. For instance, here is the config that I have and the result from running the command: //tsconfig.json
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"moduleResolution": "node",
"typeRoots": [
"node_modules/@types"
],
"types": [
"node"
]
}
} $ vuetype --watch app
Emit Failed: app\ui\flat-button.vue.d.ts
Error: Cannot find type definition file for 'node'.
Emit Failed: app\ui\title-bar.vue.d.ts
Error: Cannot find type definition file for 'node'.
Emit Failed: app\ui\forms\labeled-input.vue.d.ts
Error: Cannot find type definition file for 'node'.
Emit Failed: app\windows\credential-window\app\credential-navigation.vue.d.ts
Error: Cannot find type definition file for 'node'.
Emitted: app\windows\credential-window\app\views\credential-landing-view.vue.d.ts
Emitted: app\windows\credential-window\app\views\credential-loading-view.vue.d.ts
Emitted: app\windows\credential-window\app\views\credential-atlassian-view.vue.d.ts All three of the ones that were successful were at the exact same level, whereas the four that failed were at lower levels. My guess is that it tries to resolve the typing files at specific levels relative to the app root, but that root could be the distance from wherever the I would probably have to look into the source code further before I can say too much about it. |
Or potentially more likely, it's due to a race condition, since I made no change and ran it again and only the last two worked, then any subsequent one worked perfectly. |
So anyone found the concrete solution here? This is still a problem and removing type definitions from the tsconfig is definitively not an option. Rather the generator should pick them up. |
I haven't touched the code I was writing for months, so I am not sure what the workarounds could be. |
used the @vue/cli beta to generate a typescript project.
I am getting the errors below when I try to generate the type files
Emit Failed: C:\Users\rkk501\Documents\VsCode\t3\t3\src\components\HelloWorld.vue.d.ts
Error: Cannot find type definition file for 'jest'.
Error: Cannot find type definition file for 'node'.
If is there something in tsconfig I need to change?
The text was updated successfully, but these errors were encountered: