joeldenning / coexisting-vue-microfrontends

A repo showing separate vue apps coexisting as microfrontends with single-spa
http://coexisting-vue-microfrontends.surge.sh/
MIT License
615 stars 143 forks source link

I got the following error after my first clone! #41

Closed kavinluo closed 4 years ago

kavinluo commented 4 years ago

If you have time please tell me how to solve it, thank you very much! image

I did the following!

cd app1
npm i
npm run serve
pank789 commented 4 years ago

My teammate fixed it .

Change the root-html-file/index.html

change the code as below Add /js/ in url

"imports": { "navbar": "http://localhost:8080/js/app.js", "app1": "http://localhost:8081/js/app.js", "app2": "http://localhost:8082/js/app.js", "single-spa": "https://cdnjs.cloudflare.com/ajax/libs/single-spa/4.3.7/system/single-spa.min.js", "vue": "https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js", "vue-router": "https://cdn.jsdelivr.net/npm/vue-router@3.0.7/dist/vue-router.min.js" }

kavinluo commented 4 years ago

我的队友修复了它。

更改root-html-file / index.html

更改代码,如下所示 在url 中添加/ js /

“ imports”:{ “ navbar”:“ http:// localhost:8080 / js / app.js ”, “ app1”:“ http:// localhost:8081 / js / app.js ”, “ app2”:“ http:// localhost:8082 / js / app.js “, ” single-spa“:” https://cdnjs.cloudflare.com/ajax/libs/single-spa/4.3.7/system/single-spa。 min.js “, ” vue“:” https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js “, ” vue-router“:” https://cdn.jsdelivr。 net/npm/vue-router@3.0.7/dist/vue-router.min.js “ }

@pank789 I'm sorry, I modified it according to what you said, it hasn't been fixed, the error still remains thanks!!

joeldenning commented 4 years ago

I have updated the root html file in https://github.com/joeldenning/coexisting-vue-microfrontends/commit/6ffee3a0e733efdfc427b6b90716586dc893d850. Thanks @pank789 for raising the issue - it was related to a change I made recently in https://github.com/joeldenning/coexisting-vue-microfrontends/commit/9b680845fafbfee1183cd3ab8059e7e991afa04b