Subscribe on changes!

import Vue from 'vue' fails in js import ( works OK in Vue 2 )

avatar
May 14th 2021

Version

3.1.0-beta.3

Reproduction link

https://github.com/RUSHt/vite-module-error.git

SFC Playground

Steps to reproduce

If an imported js file has import Vue from 'vue' then the client fails to run with the error Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=d9c03fdf' does not provide an export named 'default' reported ( in chrome ).

What is expected?

No Error !

What is actually happening?

The App fails to start on the client.


I came across this when moving form Vue 2 to Vue 3

avatar
May 14th 2021

It's an intentional breaking change. See our migration guide.

avatar
May 14th 2021

You can however do import * as Vue from 'vue';


Remember to use the forum or the Discord chat to ask questions!