joeldenning / vite-single-spa-example

MIT License
63 stars 25 forks source link

The requested module single-spa-vue.js does not provide an export named default #1

Closed musashiM82 closed 3 years ago

musashiM82 commented 3 years ago

hi I get this error during running this example (installed and run with npm)

Uncaught SyntaxError: The requested module '/@modules/single-spa-vue/lib/single-spa-vue.js' does not provide an export named 'default'

npm -v 6.14.8 node -v v14.14.0

thanks in advance

joeldenning commented 3 years ago

This was caused by using single-spa-vue@1 instead of single-spa-vue@2. See https://github.com/single-spa/single-spa-vue/releases/tag/v2.0.0. The reason I didn't see the error locally is because I had single-spa-vue symlinked.

I fixed it in https://github.com/joeldenning/vite-single-spa-example/commit/6618a5b41d4a8a12a00af655fdb96bd5c84fcc46

Another thing to note is that it's more likely to work if you use yarn instead of npm - oftentimes people report bugs with my example projects when they were just using the wrong package manager, so it's a good thing to check.