Skip to content

SSR with webpack5, run renderToString() report "cannot find module ''../js/xxx.js" when use import() to lazy load components in router configs.

Notifications You must be signed in to change notification settings

YataoZhang/vueSSRwithWebpack5

Repository files navigation

vue SSR with Webpack5

first, run npm run build, and next run node scripts.js, it will report an error like this:

[vue-router] Failed to resolve async component default: Error: Cannot find module '../js/index.63fb9d8d.js'
Require stack:
Require stack:
- vueSSRwithWebpack5/node_modules/vue-server-renderer/build.dev.js
- vueSSRwithWebpack5/node_modules/vue-server-renderer/index.js
- vueSSRwithWebpack5/scripts.js
[vue-router] uncaught error during route navigation:
Error: Cannot find module '../js/index.63fb9d8d.js'
Require stack:
- vueSSRwithWebpack5/node_modules/vue-server-renderer/build.dev.js
- vueSSRwithWebpack5/node_modules/vue-server-renderer/index.js
- vueSSRwithWebpack5/scripts.js

About

SSR with webpack5, run renderToString() report "cannot find module ''../js/xxx.js" when use import() to lazy load components in router configs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published