[Fix] “export ‘default’ (imported as ‘Vue’) was not found in ‘vue’ Error

The error “”export ‘default’ (imported as ‘Vue’) was not found in ‘vue'” is an error that is invoked whenever you are using VueJS to build aaps. Given below is the snippet of the error:

"export 'default' (imported as 'Vue') was not found in 'vue'

I would like to share with you the steps I took to fix the “”export ‘default’ (imported as ‘Vue’) was not found in ‘vue'” in your project file.

Why “export ‘default’ (imported as ‘Vue’) was not found in ‘vue'” error is seen?

The error, “”export ‘default’ (imported as ‘Vue’) was not found in ‘vue'” is seen because; bootstrap-Vue does not yet support Vue 3 version.

The reason this is happening is because in Vue 2, Vue provides a default export export default vue, which allows BootstrapVue to use import Vue from 'vue'.

However, in Vue 3 it has been changed and Vue does no longer provide a default export, and instead uses named exports. So when BootstrapVue uses the following line import Vue from 'vue', the error occurs.

The detailed solution to fix the error “export ‘default’ (imported as ‘Vue’) was not found in ‘vue'”, is given below:

How to fix the error, “export ‘default’ (imported as ‘Vue’) was not found in ‘vue'”?

A simple fix for the error, you will have to downgrade to vue 2 if you wish to use bootstrap-vue.

To fix the error “export ‘default’ (imported as ‘Vue’) was not found in ‘vue'”, is follow one of the steps given below:

Bootstrap-Vue does not yet support Vue 3. So if you want to use Bootstrap-Vue you will have to stick with Vue 2 for now.

In general, most of the libraries don’t support Vue 3 yet, so I would suggest waiting a bit longer before using it until the ecosystem has caught up.

In case the error, can also use the below mentioned code:

import * as Vue from 'vue'

This should fix the error “export ‘default’ (imported as ‘Vue’) was not found in ‘vue'”

Conclusion

To fix the error “export ‘default’ (imported as ‘Vue’) was not found in ‘vue'”, you will have to downgrade to vue 2 if you wish to use bootstrap-vue.