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

Viewed 4137

enter image description here

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

2 Answers

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

This error occurs when a .vue file is missing a lang declaration. Add the following to your component file.

<script setup lang="ts"></script>

It will tell vue-tsc to treat the file as typescript so you do not have to set "allowJs": true in your tsconfig.json

Related