Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Virtual script not found, may missing <script lang="ts"> / "allowJs": true / jsconfig.json.volar

enter image description here

The image showing the blue squiggly lines indicates an error in my footer component in VueJs (TypeScript template).

like image 737
Chukwunazaekpere Avatar asked Sep 05 '25 09:09

Chukwunazaekpere


2 Answers

  1. Just in case, for anyone who use Volar in VS Code, just run command Ctrl/Cmd+Shift+P type Volar > Reload Project and the warning will go away.

  2. The more correct way (even if you are not using typescript), as others pointed out is to create jsconfig.json file in your project's root folder:

    {
       "compilerOptions": {
         "allowJs": true
       }
    }
    
like image 74
F Masruri Avatar answered Sep 08 '25 23:09

F Masruri


This issue came up in my Vue project, using typescript template. To solve the problem above, go to the tsconfig.json file, under the compilerOptions object-property, add:

"allowJs": true
like image 29
Chukwunazaekpere Avatar answered Sep 08 '25 22:09

Chukwunazaekpere