Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Vue.js: error TS6504: File xxx.vue.js is a JavaScript file. Did you mean to enable the allowJs

16.03.2023 (👁3855)


 

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"

    }

  ]

}

 

Ein Bild, das Text enthält.

Automatisch generierte Beschreibung