Closed sentiasa closed 5 years ago
I tried to write this in the blogpost but it got marked as spam :( So I'm putting it here
Hi @anthonygore. thanks for the in-depth explanation. I made everything work but dynamic component loading in router doesn't work.
This works:
import Home from '../view/Home'; export const routes = [{ path: '/', name: "Home", component: Home }]
but this doesn't:
export const routes = [{ path: '/', name: "Home", component: () => import('../views/Home.vue)' }]
and I get <div id="app" data-server-rendered="true"></div>.
<div id="app" data-server-rendered="true"></div>
and if I use this, it crashes with
export const routes = [{ path: '/', name: "Home", component: import('../views/Home.vue)' }]
Cannot find module './js/chunks/server/0.js
What do you think I am missing/doing wrong? I'd appreciate any help 🙏
If anyone wonders, this is how I achieved it - https://stackoverflow.com/questions/58216963/lazy-loaded-vue-router-components-dont-work-with-ssr/58297349#58297349
I tried to write this in the blogpost but it got marked as spam :( So I'm putting it here
Hi @anthonygore. thanks for the in-depth explanation. I made everything work but dynamic component loading in router doesn't work.
This works:
but this doesn't:
and I get
<div id="app" data-server-rendered="true"></div>
.and if I use this, it crashes with
What do you think I am missing/doing wrong? I'd appreciate any help 🙏