Vue / Volar extension in Visual Studio Code keeps crashing: The JS/TS language service immediately crashed 5 times…

842 Views Asked by At

I just wasted a day on this, so I thought I would get it down incase anyone else is experiencing it.

Opened a vue 3 project and got the following error:

The JS/TS language service immediately crashed 5 times. The service will not be restarted....

And then it listed a bunch of possible extensions that might be causing it - one of which is Vue.volar.

Disabling the Vue - Official extension does stop the crash, but then we have no vue or TypeScript language services in VS Code.

I narrowed it down to destructuring objects in HTML attributes in a vue template:

 <RouterView v-slot="{Component}">
   <Transition name="fade" appear>
     <component :is="Component" />
   </Transition>
 </RouterView>

If you change that to

 <RouterView v-slot="props">
   <Transition name="fade" appear>
     <component :is="props.Component" />
   </Transition>
 </RouterView>

Its fine - but a workaround....

2

There are 2 best solutions below

4
Matt Bryson On BEST ANSWER

Turns out the issue started in the 2.0 release of Vue - Official

You can roll Vue - Official back to older versions.

  • Search for Vue - Official in the VS Code extensions panel.
  • Hit the cog icon
  • choose Install another version...

For me, the earliest working build was 1.8.27

0
Zohaib Ijaz On

Install previous version using command line

code --install-extension [email protected]