Comments (3)
This means that the request to download the navbar returned HTML instead of javascript. There was a bug that I fixed in 6ffee3a that solves this.
If that doesn't solve your issue, please provide more detail, including the following:
- Are you running all applications locally? Or one at a time
- What URL are you visiting in the browser?
- What URL is the navbar being downloaded from?
from coexisting-vue-microfrontends.
Sorry to reopen it,
I'm facing the exact same issue with my vue.js navbar.
I have three microfrontends:
- vue.js( 2.6.11) navbar
- react app
- angular app
- and a root-config
Except the navbar, the other apps work gracefully.
- I am running all the apps locally
- visiting http://localhost:9000
- http://localhost:9000
Here are the root config files:
root.config.js
import { registerApplication, start } from "single-spa";
registerApplication({
name: "@joblesschool/navbar",
app: () => System.import("@joblesschool/navbar"),
activeWhen: ["/"],
});
registerApplication({
name: "@joblesschool/seeker-service",
app: () => System.import("@joblesschool/seeker-service"),
activeWhen: ["/seeker"],
});
registerApplication({
name: "@joblesschool/digger-service",
app: () => System.import("@joblesschool/digger-service"),
activeWhen: ["/recruiter"],
});
start({
urlRerouteOnly: true,
});
index.ejs
<% if (isLocal) { %>
<script type="systemjs-importmap">
{
"imports": {
"react": "https://cdn.jsdelivr.net/npm/[email protected]/umd/react.development.js",
"react-dom": "https://cdn.jsdelivr.net/npm/[email protected]/umd/react-dom.development.js",
"@joblesschool/root-config": "//localhost:9000/joblesschool-root-config.js",
"@joblesschool/seeker-service": "//localhost:9001/joblesschool-seeker-service.js",
"@joblesschool/digger-service": "//localhost:9002/joblesschool-digger-service.js",
"@joblesschool/navbar": "//localhost:9003/joblesschool-navbar.js"
}
}
</script>
<% } %>
vue.js navbar related files
// main.js
import "./set-public-path";
import Vue from "vue";
import singleSpaVue from "single-spa-vue";
import App from "./App.vue";
import router from "./router";
Vue.config.productionTip = false;
const vueLifecycles = singleSpaVue({
Vue,
appOptions: {
render: h => h(App),
router
}
});
export const bootstrap = vueLifecycles.bootstrap;
export const mount = vueLifecycles.mount;
export const unmount = vueLifecycles.unmount;
// set-public-path.js
import { setPublicPath } from "systemjs-webpack-interop";
setPublicPath("@joblesschool/navbar");
// index.js
import Vue from "vue";
import VueRouter from "vue-router";
import NavBar from "../components/Navbar";
Vue.use(VueRouter);
const routes = [{path: "/", component: NavBar}];
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
routes
});
export default router;
// vue.config.js
module.exports = {
lintOnSave: false,
publicPath: '/',
configureWebpack: {
devServer: {
headers: {
"Access-Control-Allow-Origin": "*"
},
disableHostCheck: true,
sockPort: 9003,
sockHost: "localhost",
https: false,
port: 9003
},
externals: ["vue","vue-router", /^@joblesschool\/.+/]
},
filenameHashing: false
};
Looking forward to hearing you soon.
from coexisting-vue-microfrontends.
My previous answer still applies - this means that the URL for one of your applications is returning HTML instead of javascript. To diagnose, go directly to the URL for the javascript file of the application in a separate browser tab. You should see javascript instead of an HTML page. If you see an HTML page, then it means that you have the wrong URL.
from coexisting-vue-microfrontends.
Related Issues (20)
- [QUESTION] Vite version of this O_O
- Coexisting vue2 and vue3
- Uncaught Error: systemjs-webpack-interop: There is no such module 'app1' in the SystemJS registry. Did you misspell the name of your module? HOT 1
- We're sorry but app1 doesn't work properly without JavaScript enabled. Please enable it to continue. HOT 1
- 请问如果需要通过router的name跳转页面,有没有好的解决方案呢?目前是不是只支持path跳转 HOT 5
- Issues with vue cli v4.x.x still happen HOT 2
- Images from the individual applications doesnt appear HOT 3
- I got the following error after my first clone! HOT 3
- When I don't start the root service, but I start the app1 service HOT 2
- What happens when I add my own project to start?
- When I visited it, I found that it didn't seem to work anymore HOT 2
- codes can not be cloned HOT 1
- why do this in 'root-html-file/index.html' HOT 2
- My current needs need to be able to communicate in various projects and pass data to each other for access. HOT 1
- Question: New Example Repo HOT 2
- vue 3 and vue-router 4 HOT 6
- 跨域了,这么办呢 HOT 2
- what if we use third-party ui library like element-ui,and has to import seperate css file HOT 2
- How to add SSR the proper way to this project? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coexisting-vue-microfrontends.