I am getting a typescript error that shouldn't happen because the tsconfig should prevent it from being compiled. In my tsconfig file I have skipLibCheck set to true. I have the node_modules folder in the excludes section, as well as other variations of it with wildcards as well. The errors I am getting are build errors in the ts file.
This was done after the version of vue was upgraded from 2 to 3. And the ts file is under the node_modules/@vue folder, so there might be a connection. We do have three different tsconfig files, one at the root, and the eother two are in separate sections that require separate settings.
This project is massive and too large to upload a working copy to replicate this issue.
Is the issue purely typescript, or is it vue related?
These are the things I have tried. But I still get the errors as if the tsconfig is being ignored.
I have tried variations in the tsconfig of the node_modules folder.
I have tried adding an entry in the tsconfig with the full path to the file.
Uninstalling and re-installing the latest version of typescript
Setting the target to ES6 and ESNext
Deleting the node_modules folder and reinstalling everything.
Set compileOnSave to false
I am expecting the project to build successfully since the ts files should not be compiled at all.
Root tsconfig:
{
"compilerOptions": {
"target": "es5",
"inlineSourceMap": true,
"skipLibCheck": true,
"types": [
"node",
"jquery"
]
},
"exclude": [
"ClientApp/**/*",
"ClientApp/**/*.js",
"ClientApp/**/*.vue",
"ClientAppPublic/**/*",
"ClientAppPublic/**/*.js",
"ClientAppPublic/**/*.vue",
"Scripts/Kendo/**",
"Scripts/ckeditor/**",
"Scripts/core-js/**",
"Scripts/moment/**",
"Scripts/jquery-*",
"Scripts/jquery.*.js",
"Scripts/knockout-*",
"Scripts/typings/**",
"**/publish.ts",
"node_modules",
"./node_modules",
"./node_modules/*",
"./node_modules/**",
"./node_modules/@types/node/index.d.ts",
"./XULRunner21_0/**",
"./XULRunner38_0/**"
]
}
tsconfig 2:
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"maxNodeModuleJsDepth": 2,
"module": "ESNext",
"moduleResolution": "Node",
"noEmit": true,
"target": "ESNext",
"skipLibCheck": true,
"baseUrl": ".",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable",
"ScriptHost",
"WebWorker.ImportScripts"
],
"paths": {
"@/*": [ "./*" ],
"modules": [ "../node_modules/*" ],
"vue_components/*": [ "./components/*" ],
"vue_views/*": [ "./views/*" ],
"directives/*": [ "./directives/*" ],
"images/*": [ "../Content/documatix/Images/*" ],
"legacyutil/*": [ "../App_Scripts/*" ],
"scss/*": [ "../Content/documatix/*" ]
},
"removeComments": true,
"sourceMap": true,
"typeRoots": [
"../node_modules/@types",
"../node_modules/vuetify/types"
],
"types": [
"node",
"jquery",
"vuetify"
]
},
"exclude": [
"node_modules"
]
}
tsconfig 3:
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"maxNodeModuleJsDepth": 2,
"module": "ESNext",
"moduleResolution": "Node",
"noEmit": true,
"target": "ESNext",
"skipLibCheck": true,
"baseUrl": ".",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable",
"ScriptHost",
"WebWorker.ImportScripts"
],
"paths": {
"@/*": [ "./*" ],
"modules": [ "../node_modules/*" ],
"vue_components/*": [ "./components/*" ],
"vue_views/*": [ "./views/*" ],
"directives/*": [ "./directives/*" ],
"images/*": [ "../Content/documatix/Images/*" ],
"legacyutil/*": [ "../App_Scripts/*" ],
"scss/*": [ "../Content/documatix/*" ]
},
"removeComments": true,
"sourceMap": true,
"typeRoots": [
"../node_modules/@types",
"../node_modules/vuetify/types"
],
"types": [
"node",
"jquery",
"vuetify"
]
},
"exclude": [
"node_modules"
]
}
I am getting a typescript error that shouldn't happen because the tsconfig should prevent it from being compiled. In my tsconfig file I have skipLibCheck set to true. I have the node_modules folder in the excludes section, as well as other variations of it with wildcards as well. The errors I am getting are build errors in the ts file.
This was done after the version of vue was upgraded from 2 to 3. And the ts file is under the node_modules/@vue folder, so there might be a connection. We do have three different tsconfig files, one at the root, and the eother two are in separate sections that require separate settings.
This project is massive and too large to upload a working copy to replicate this issue.
Is the issue purely typescript, or is it vue related?
These are the things I have tried. But I still get the errors as if the tsconfig is being ignored.
I have tried variations in the tsconfig of the node_modules folder.
I have tried adding an entry in the tsconfig with the full path to the file.
Uninstalling and re-installing the latest version of typescript
Setting the target to ES6 and ESNext
Deleting the node_modules folder and reinstalling everything.
Set compileOnSave to false
I am expecting the project to build successfully since the ts files should not be compiled at all.
Root tsconfig:
{
"compilerOptions": {
"target": "es5",
"inlineSourceMap": true,
"skipLibCheck": true,
"types": [
"node",
"jquery"
]
},
"exclude": [
"ClientApp/**/*",
"ClientApp/**/*.js",
"ClientApp/**/*.vue",
"ClientAppPublic/**/*",
"ClientAppPublic/**/*.js",
"ClientAppPublic/**/*.vue",
"Scripts/Kendo/**",
"Scripts/ckeditor/**",
"Scripts/core-js/**",
"Scripts/moment/**",
"Scripts/jquery-*",
"Scripts/jquery.*.js",
"Scripts/knockout-*",
"Scripts/typings/**",
"**/publish.ts",
"node_modules",
"./node_modules",
"./node_modules/*",
"./node_modules/**",
"./node_modules/@types/node/index.d.ts",
"./XULRunner21_0/**",
"./XULRunner38_0/**"
]
}
tsconfig 2:
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"maxNodeModuleJsDepth": 2,
"module": "ESNext",
"moduleResolution": "Node",
"noEmit": true,
"target": "ESNext",
"skipLibCheck": true,
"baseUrl": ".",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable",
"ScriptHost",
"WebWorker.ImportScripts"
],
"paths": {
"@/*": [ "./*" ],
"modules": [ "../node_modules/*" ],
"vue_components/*": [ "./components/*" ],
"vue_views/*": [ "./views/*" ],
"directives/*": [ "./directives/*" ],
"images/*": [ "../Content/documatix/Images/*" ],
"legacyutil/*": [ "../App_Scripts/*" ],
"scss/*": [ "../Content/documatix/*" ]
},
"removeComments": true,
"sourceMap": true,
"typeRoots": [
"../node_modules/@types",
"../node_modules/vuetify/types"
],
"types": [
"node",
"jquery",
"vuetify"
]
},
"exclude": [
"node_modules"
]
}
tsconfig 3:
{
"compileOnSave": false,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"maxNodeModuleJsDepth": 2,
"module": "ESNext",
"moduleResolution": "Node",
"noEmit": true,
"target": "ESNext",
"skipLibCheck": true,
"baseUrl": ".",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable",
"ScriptHost",
"WebWorker.ImportScripts"
],
"paths": {
"@/*": [ "./*" ],
"modules": [ "../node_modules/*" ],
"vue_components/*": [ "./components/*" ],
"vue_views/*": [ "./views/*" ],
"directives/*": [ "./directives/*" ],
"images/*": [ "../Content/documatix/Images/*" ],
"legacyutil/*": [ "../App_Scripts/*" ],
"scss/*": [ "../Content/documatix/*" ]
},
"removeComments": true,
"sourceMap": true,
"typeRoots": [
"../node_modules/@types",
"../node_modules/vuetify/types"
],
"types": [
"node",
"jquery",
"vuetify"
]
},
"exclude": [
"node_modules"
]
}
Share
Improve this question
asked Mar 5 at 20:35
SChristiansenSChristiansen
12 bronze badges
4
- Please, check stackoverflow/help/how-to-ask . It's unknown what your case is and how it could be solved. "a typescript error" - which error and which process does cause it? How exactly is ts used? – Estus Flask Commented Mar 6 at 7:56
- I think the issue is that it should be ignoring the typescript files. The excludes section of the tsconfig should ignore the file altogether. So I posted the tsconfig files in hopes something was wrong with them that I couldn't see. – SChristiansen Commented Mar 6 at 14:38
- I see no problems in tsconfig itself. There may be no need to publish the whole copy but there's still an need for stackoverflow/help/mcve . This is likely specific to your setup, which is unknown. This could be anything, including bugs in the toolchain – Estus Flask Commented Mar 6 at 15:49
- I found a solution. I changed the TypeScriptCompileBlocked setting in the project to true. <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> – SChristiansen Commented Mar 7 at 17:16
1 Answer
Reset to default 0I found a solution. I changed the TypeScriptCompileBlocked
setting in the project to true
.
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>