Vorkommen:
In vue.js mit TypeScript
Fehler:
error TS6504: File ../src/views/Articles/Articles.vue.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? The file is in the program because: Matched by include pattern 'src/**/*' in ../tsconfig.json'
tsconfig.json:3:27 3 "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], ~~~~~~~~~~ File is matched by include pattern specified here. |
Solution:
in der Datei tsconfig.json muss man die Zeile allowJs:true einfügen
{ "extends": "@vue/tsconfig/tsconfig.web.json", "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "compilerOptions": { "baseUrl": ".", "allowJs": true, "paths": { "@/*": ["./src/*"] } },
"references": [ { "path": "./tsconfig.node.json" } ] }
|