“export ‘createWebHistory’ was not found in ‘vue-router’

By | March 5, 2021

Are you getting the error “export ‘createWebHistory’ was not found in ‘vue-router’ or “export ‘createRouter’ was not found in ‘vue-router’?

A quick search on the Interweb will show that you have run

npm install vue-router

instead of

npm install vue-router@next

npm install vue-router will install the latest “tagged” version which is 3.5.1. Next is a tag which installs v4.0.4.

Alternatively you could have run:

npm install vue-router@4.0.4

and that would work as well.

Note that you don’t have to uninstall vue-router in order to upgrade. You can just install a newer or another version and it will overwrite the existing version.

What is interesting to note is that various issues were resolved in v4.0.0-alpha.6

Leave a Reply

Your email address will not be published. Required fields are marked *