Skip to content

fix(deps): pin webpack-dev-server to 6.0.0 to stop the block editor reload loop - #846

Merged
aryanjasala merged 1 commit into
mainfrom
fix/webpack-dev-server-pin
Nov 10, 2026
Merged

aryanjasala merged 1 commit into
mainfrom
fix/webpack-dev-server-pin

Conversation

@aryanjasala

Copy link
Copy Markdown
Member

What this PR does

Fixes a regression from #842: under npm start the block editor reloads in a loop. Aditya found it on plugin-elementary#81; the theme has the same setup (wp-scripts 37, --experimental-modules, webpack-dev-server 6.1.0), so it has the same bug.

webpack-dev-server 6.1.0 hands its browser client to webpack-dev-middleware 8.4, which checks lastHash === __webpack_hash__. With --experimental-modules there are two compilers, so the server sends a combined hash that never equals the page's own; the client asks for a hot-update.json that doesn't exist, gets a 404 and reloads. 6.0.0's client accepted a hash that contains the page's, so it is stable on the same setup. 6.1.0 is the latest release.

Changes

  • webpack-dev-server 6.0.0 in devDependencies, with "webpack-dev-server": "$webpack-dev-server" in overrides. Both are needed: the override alone nests the pin under @wordpress/scripts, where webpack-cli can't find it. The lockfile change is 6.1.0 → 6.0.0 plus ansi-html-community 0.0.8.
  • A Known gaps entry in docs/internal/maintenance.md: why the pin is there, and when and how to drop it.

How I verified

  • Same pin Aditya verified on plugin-elementary#81: the editor loads once, and a block edit.js change hot-applies without a reload.
  • Compared the two clients: 6.0.0 has currentHash.indexOf(previousHash) >= 0, and webpack-dev-middleware 8.4's client/process-update.js has lastHash === __webpack_hash__.
  • npm ls webpack-dev-server shows 6.0.0 at the top level, deduped under @wordpress/scripts.

Reviewer notes

Merge before the 2.0.1 release PR (#840), so the release doesn't ship the loop.

@aryanjasala
aryanjasala merged commit c908371 into main Nov 10, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants