__webpack_require__.d is not a function
See original GitHub issueBug report
What is the current behavior?
I have a big/medium sized project using webpack 5.36.2. just migrated from webpack 4.44.2. which worked fine for my team but the speed improvement between those two versions is just insane. Thank you for that. I noticed that optimization.runtimeChunk = true gave an extra performance boost, but the resulting bundle shows an error “webpack_require.d is not a function” which seams to happen just in that project. i tried to isolate the error in a small test repo. if i set optimization.runtimeChunk = false then the error disappears, but the build time is significantly higher. sometimes its “webpack_require.r is not a function”.
If the current behavior is a bug, please provide the steps to reproduce.
- clone this repo https://github.com/code1x1/webpack-require-d-is-not-a-function
- run
npm run start
- open http://localhost:3000 in your browser
- open developer console in your browser
What is the expected behavior?
optimization.runtimeChunk = true should build the bundle and the runtime.~chunk.js should contain webpack_require.d definition which is missing.
Other relevant information: webpack version: 5.36.2 Node.js version: v12.16.3 Operating System: Debian GNU/Linux 10 (buster) Additional tools: npm 6.14.12
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top GitHub Comments
Change
runtimeChunk: 'true'
on ``runtimeChunk: ‘single’, also you need
webpack-dev-server@4-beta.3` with options:Stable release will be soon, have to respond and it slows down
thanks