fix: support webpack-dev-server 6.x by dropping SockJS instanceof checks - #1046
Open
rtm-ctrlz wants to merge 1 commit into
Open
fix: support webpack-dev-server 6.x by dropping SockJS instanceof checks#1046rtm-ctrlz wants to merge 1 commit into
rtm-ctrlz wants to merge 1 commit into
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
rtm-ctrlz
force-pushed
the
fix/webpack-dev-server-6-sockjs
branch
from
July 24, 2026 23:00
0e0df87 to
257c43a
Compare
WDS 6.0.0 removed the SockJSClient module, which broke WDSSocket.js's require() of it with a compile-time "Module not found" error. Detect the active client via duck-typing on `.sock`/`.client` instead of instanceof checks against imported client classes, which works unchanged across WDS 4/5/6 and needs no optional require. Also widen the webpack-dev-server peer range to include 6.x and extend the test harness/CI matrix to cover it.
|
Thank you guys! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
webpack-dev-server6.0.0 removed the SockJS client, butsockets/WDSSocket.jsstill did a staticrequire('webpack-dev-server/client/clients/SockJSClient')and aninstanceofcheck against it. On WDS 6, that module path no longer resolves, so webpack fails to compile with:client.sock/client.clientinstead ofinstanceofchecks against imported client classes. This removes the need torequire()a module that may not exist, so there's no compile-time warning/error on any supported WDS version, and it works unchanged across WDS 4/5/6.webpack-dev-serverpeer dependency range to^4.8.0 || 5.x || 6.x.webpack-dev-server-v6dev alias,aliasWDSv6.js) and CI matrix to also run against WDS 6.Test plan
yarn lint/yarn format:checkyarn test --testPathIgnorePatterns conformance)yarn test conformance) — all 16 tests pass locally against WDS 4, WDS 5, and WDS 6 (WDS_VERSION=4|5|6)Fixes #1014