Update the webpack version bundled in next#89569
Update the webpack version bundled in next#89569lukesandberg wants to merge 3 commits intocanaryfrom
Conversation
Failing test suitesCommit: 2608499 | About building and testing Next.js
Expand output● app-dir hmr-env › should update server components pages when env files is changed (edge) ● app-dir hmr-env › should update server components pages when env files is changed (edge-module-var)
Expand output● app-dir-hmr › filesystem changes › should update server components after navigating to a page with a different runtime |
Stats from current PR🔴 1 regression
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **397 kB** → **397 kB**
|
| Canary | PR | Change | |
|---|---|---|---|
| middleware-b..fest.js gzip | 757 B | 763 B | ✓ |
| Total | 757 B | 763 B |
Build Details
Build Manifests
| Canary | PR | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 452 B | 449 B | ✓ |
| Total | 452 B | 449 B | ✅ -3 B |
📦 Webpack
Client
Main Bundles
| Canary | PR | Change | |
|---|---|---|---|
| 5528-HASH.js gzip | 5.47 kB | N/A | - |
| 6280-HASH.js gzip | 57.1 kB | N/A | - |
| 6335.HASH.js gzip | 169 B | N/A | - |
| 912-HASH.js gzip | 4.53 kB | N/A | - |
| e8aec2e4-HASH.js gzip | 62.6 kB | N/A | - |
| framework-HASH.js gzip | 59.7 kB | 59.7 kB | ✓ |
| main-app-HASH.js gzip | 255 B | 251 B | 🟢 4 B (-2%) |
| main-HASH.js gzip | 39.1 kB | 38.7 kB | 🟢 440 B (-1%) |
| webpack-HASH.js gzip | 1.68 kB | 1.68 kB | ✓ |
| 262-HASH.js gzip | N/A | 4.52 kB | - |
| 2889.HASH.js gzip | N/A | 163 B | - |
| 5602-HASH.js gzip | N/A | 5.47 kB | - |
| 6948ada0-HASH.js gzip | N/A | 62.6 kB | - |
| 9544-HASH.js gzip | N/A | 54.7 kB | - |
| Total | 231 kB | 228 kB | ✅ -2.81 kB |
Polyfills
| Canary | PR | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 39.4 kB | 39.4 kB | ✓ |
| Total | 39.4 kB | 39.4 kB | ✓ |
Pages
| Canary | PR | Change | |
|---|---|---|---|
| _app-HASH.js gzip | 194 B | 191 B | 🟢 3 B (-2%) |
| _error-HASH.js gzip | 183 B | 177 B | 🟢 6 B (-3%) |
| css-HASH.js gzip | 331 B | 330 B | ✓ |
| dynamic-HASH.js gzip | 1.81 kB | 1.8 kB | ✓ |
| edge-ssr-HASH.js gzip | 256 B | 254 B | ✓ |
| head-HASH.js gzip | 351 B | 351 B | ✓ |
| hooks-HASH.js gzip | 384 B | 382 B | ✓ |
| image-HASH.js gzip | 580 B | 578 B | ✓ |
| index-HASH.js gzip | 260 B | 258 B | ✓ |
| link-HASH.js gzip | 2.5 kB | 2.49 kB | ✓ |
| routerDirect..HASH.js gzip | 320 B | 318 B | ✓ |
| script-HASH.js gzip | 386 B | 385 B | ✓ |
| withRouter-HASH.js gzip | 315 B | 314 B | ✓ |
| 1afbb74e6ecf..834.css gzip | 106 B | 106 B | ✓ |
| Total | 7.97 kB | 7.93 kB | ✅ -36 B |
Server
Edge SSR
| Canary | PR | Change | |
|---|---|---|---|
| edge-ssr.js gzip | 126 kB | 125 kB | ✓ |
| page.js gzip | 249 kB | 244 kB | 🟢 5 kB (-2%) |
| Total | 374 kB | 369 kB | ✅ -5.78 kB |
Middleware
| Canary | PR | Change | |
|---|---|---|---|
| middleware-b..fest.js gzip | 616 B | 615 B | ✓ |
| middleware-r..fest.js gzip | 156 B | 156 B | ✓ |
| middleware.js gzip | 43.6 kB | 43.5 kB | ✓ |
| edge-runtime..pack.js gzip | 842 B | 842 B | ✓ |
| Total | 45.2 kB | 45.1 kB | ✅ -126 B |
Build Details
Build Manifests
| Canary | PR | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 715 B | 716 B | ✓ |
| Total | 715 B | 716 B |
Build Cache
| Canary | PR | Change | |
|---|---|---|---|
| 0.pack gzip | 3.87 MB | 3.85 MB | 🟢 19.4 kB (-1%) |
| index.pack gzip | 103 kB | 103 kB | ✓ |
| index.pack.old gzip | 102 kB | 103 kB | ✓ |
| Total | 4.07 MB | 4.05 MB | ✅ -19.6 kB |
🔄 Shared (bundler-independent)
Runtimes
| Canary | PR | Change | |
|---|---|---|---|
| app-page-exp...dev.js gzip | 316 kB | 316 kB | ✓ |
| app-page-exp..prod.js gzip | 167 kB | 167 kB | ✓ |
| app-page-tur...dev.js gzip | 315 kB | 315 kB | ✓ |
| app-page-tur..prod.js gzip | 167 kB | 167 kB | ✓ |
| app-page-tur...dev.js gzip | 312 kB | 312 kB | ✓ |
| app-page-tur..prod.js gzip | 165 kB | 165 kB | ✓ |
| app-page.run...dev.js gzip | 312 kB | 312 kB | ✓ |
| app-page.run..prod.js gzip | 165 kB | 165 kB | ✓ |
| app-route-ex...dev.js gzip | 70.5 kB | 70.5 kB | ✓ |
| app-route-ex..prod.js gzip | 49 kB | 49 kB | ✓ |
| app-route-tu...dev.js gzip | 70.5 kB | 70.5 kB | ✓ |
| app-route-tu..prod.js gzip | 49 kB | 49 kB | ✓ |
| app-route-tu...dev.js gzip | 70.1 kB | 70.1 kB | ✓ |
| app-route-tu..prod.js gzip | 48.8 kB | 48.8 kB | ✓ |
| app-route.ru...dev.js gzip | 70.1 kB | 70.1 kB | ✓ |
| app-route.ru..prod.js gzip | 48.7 kB | 48.7 kB | ✓ |
| dist_client_...dev.js gzip | 324 B | 324 B | ✓ |
| dist_client_...dev.js gzip | 326 B | 326 B | ✓ |
| dist_client_...dev.js gzip | 318 B | 318 B | ✓ |
| dist_client_...dev.js gzip | 317 B | 317 B | ✓ |
| pages-api-tu...dev.js gzip | 43.2 kB | 43.2 kB | ✓ |
| pages-api-tu..prod.js gzip | 32.9 kB | 32.9 kB | ✓ |
| pages-api.ru...dev.js gzip | 43.2 kB | 43.2 kB | ✓ |
| pages-api.ru..prod.js gzip | 32.8 kB | 32.8 kB | ✓ |
| pages-turbo....dev.js gzip | 52.5 kB | 52.5 kB | ✓ |
| pages-turbo...prod.js gzip | 38.4 kB | 38.4 kB | ✓ |
| pages.runtim...dev.js gzip | 52.5 kB | 52.5 kB | ✓ |
| pages.runtim..prod.js gzip | 38.4 kB | 38.4 kB | ✓ |
| server.runti..prod.js gzip | 63.5 kB | 63.5 kB | ✓ |
| Total | 2.8 MB | 2.8 MB |
📝 Changed Files (4 files)
Files with changes:
app-page-exp..ntime.dev.jsapp-page-tur..ntime.dev.jsapp-page-tur..ntime.dev.jsapp-page.runtime.dev.js
View diffs
app-page-exp..ntime.dev.js
Diff too large to display
app-page-tur..ntime.dev.js
Diff too large to display
app-page-tur..ntime.dev.js
Diff too large to display
app-page.runtime.dev.js
Diff too large to display
342ce8b to
929239e
Compare
929239e to
9e9cb6f
Compare
9e9cb6f to
0ce5372
Compare
…ents During HMR, the dev server sends BUILT (triggering async module.hot.apply()) before SERVER_COMPONENT_CHANGES (triggering hmrRefresh()). Previously, hmrRefresh() fired immediately without waiting for the webpack update to finish, creating a race where __webpack_require__ could be called for modules that were temporarily absent from __webpack_modules__ during the swap. This was previously masked because the resulting TypeError was caught by React's error boundary, but webpack 5.104+ added an explicit module existence check that turns this into a hard "Cannot find module" error. Fix by awaiting the pendingHotUpdateWebpack promise before calling hmrRefresh(), ensuring all webpack modules are fully in place before the RSC response tries to reference them.
4082f78 to
2608499
Compare

Upgrade webpack 5.98.0 → 5.105.0
Updates webpack from 5.98.0 to 5.105.0 and webpack-dev-server from 5.2.0 to 5.2.3.
Notable webpack changes
New Features:
tsconfigresolver option - can replacetsconfig-paths-webpack-plugin(v5.105.0)import.defer()support for context modules (v5.105.0)devtooloption (v5.105.0)DotenvPluginand top-leveldotenvoption (v5.103.0)WebpackManifestPlugin(v5.103.0)import.meta.env,import.meta.dirname,import.meta.filenamesupport (v5.103.0)exportTypeoption (link,text,css-style-sheet) (v5.103.0){ type: "bytes" }and{ type: "text" }(v5.102.0)Stabilized (no longer experimental):
topLevelAwait(v5.102.0)layers(v5.102.0)Bug Fixes & Security:
HttpUriPlugin(v5.104.1)webpack-dev-server 5.2.0 → 5.2.3
HMR race condition fix
Webpack 5.104+ added a module existence check in `webpack_require` (when `output.pathinfo` is true, the default in dev mode) that surfaced a pre-existing race condition in Next.js's HMR protocol.
The race: When a server component changes, the dev server sends `BUILT` (triggering async `module.hot.apply()`) followed by `SERVER_COMPONENT_CHANGES` (triggering `hmrRefresh()`). Previously, `hmrRefresh()` fired immediately without waiting for the webpack update to finish, so `webpack_require` could be called for client components that were temporarily absent from `webpack_modules` during the swap. This was silently caught by React error boundaries with old webpack, but the new explicit module existence check turns it into a hard error.
The fix: Wait for the pending webpack HMR promise to resolve before calling `hmrRefresh()`, ensuring all modules are fully in place before the RSC response references them.
Known Breaking changes
Breaking change for `experimental.urlImports` users: Webpack 5.105.0 now validates redirect target URLs against the `allowedUris` policy. If your URL imports redirect to a different domain (e.g., `github.com/...` → `raw.githubusercontent.com/...`), you must add the redirect target domain to your `urlImports` array.
Full changelogs
Blocked on webpack/webpack#20475
Fixes #89177