"export" 'Vue' was not found in 'vue'

Viewed 2902
3 Answers

try importing with this.

if (process.client) {
  import vue from 'vue'
}

You say you've recently upgraded to Vue 3. The import Vue from 'vue' syntax is no longer supported, since Vue has been restructured to support tree-shaking.

Instead of trying to use Vue.function, simply import { function } from 'vue' and use it directly.

This is documented in the migration guide here: https://v3-migration.vuejs.org/breaking-changes/global-api-treeshaking.html#global-api-treeshaking

I'd recommend giving the rest of the migration guide (at least the breaking changes) a read-through as well. It's very handy.

Related