Vue.js: error
TS6504: File xxx.vue.js is a Javascript file. Did you
mean to enable the allowJs
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"
}
]
}
|