you may see the video first: https://cl.ly/1Y0g0J43273y
each page has a dynamic component.
link to one of other pages, and the dynamic component load failed
example: https://github.com/comus/with-dynamic-import
go to every page without error
none
@timneutkens any thoughts?
above is [email protected]
shows error: "GET http://localhost:3000/_next/webpack/6-undefined.js 404 (Not Found)"
below i try [email protected]
also have errors but a little bit different
shows: "GET http://localhost:3000/_next/webpack/6.js 404 (Not Found)", without undefined hash string
screenshot:
https://www.dropbox.com/s/mnflngnxckszilg/Screenshot%202018-06-21%2017.38.06.png?dl=0
Duplicate of #3775
thx.
finally, my temporary solution for development environment:
/lib/common.js and dynamic-import all the dynamic componentsconst dynamics = () => [
import('../components/hello1'),
import('../components/hello2'),
import('../components/hello3'),
import('../components/hello4')
]
common.js fileimport '../lib/common'
Thats it. the common.js file helps webpack/bootstrap to create a correct chunks mapping list during development environment, so temporary say bye to those errors
script.src = __webpack_require__.p + "" + ({"0":"main.js","1":"bundles/pages/_error.js","2":"bundles/pages/_app.js","4":"chunks/components_hello1_2118a1d2a4935c3fb995190faa8dbd95","5":"chunks/components_hello4_4c239e4dc0cd2618c3e111f41c791a1c","6":"chunks/components_hello3_693127fc8d6e8d58856e50574974e451","7":"chunks/components_hello2_23440136ce0953a1f9b2387ab3c13db4","8":"bundles/pages/index.js"}[chunkId]||chunkId) + ".js";
for production, just comment out import '../lib/common' or just leave it here
Most helpful comment
thx.
finally, my temporary solution for development environment:
/lib/common.jsand dynamic-import all thedynamic componentscommon.jsfileThats it. the
common.jsfile helpswebpack/bootstrapto create a correct chunks mapping list during development environment, so temporary say bye to those errorsfor production, just comment out
import '../lib/common'or just leave it here