Skip to content

[GATE-1102]: Fix webpackDevServer config for webpack-dev-server v5 compatibility#202

Merged
Alex Sannikov (xalechez) merged 2 commits into
mainfrom
GATE-1102-fix-webpack-dev-server-config
Jun 23, 2026
Merged

[GATE-1102]: Fix webpackDevServer config for webpack-dev-server v5 compatibility#202
Alex Sannikov (xalechez) merged 2 commits into
mainfrom
GATE-1102-fix-webpack-dev-server-config

Conversation

@mholwill

@mholwill Malcolm Holwill (mholwill) commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • Replaces the removed top-level https option with the v5 server option, mapping getHttpsConfig() output to the correct format ('http', 'https', or { type: 'https', options: { cert, key } })
  • Replaces the removed onBeforeSetupMiddleware/onAfterSetupMiddleware hooks with the v5 setupMiddlewares API

Context

backpack-react-scripts@11.2.3 pulled in webpack-dev-server@^5.2.2 but webpackDevServer.config.js still used v4 APIs, causing this schema validation error on startup in profile, login and subscription-microsite:

options has an unknown property 'https'. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, ipc?, liveReload?, onListening?, open?, port?, proxy?, server?, app?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }

Those consumers worked around it by either reverting to 11.2.2 (profile) or overriding wds back to v4 (login, subscription-microsite). Once this is released as 11.2.4 they can bump to the fixed version and remove their workarounds.

Fixes GATE-1102

TESTING:

Tested locally by packing the patched version with npm pack and installing the tarball directly into profile/client. Ran client dev server and it started successfully with no schema validation errors

🤖 Generated with Claude Code

…atibility

webpack-dev-server v5 removed the top-level `https` option (now nested under
`server`) and replaced `onBeforeSetupMiddleware`/`onAfterSetupMiddleware` with
`setupMiddlewares`. This caused a schema validation error on startup in microsites
using backpack-react-scripts@11.2.3.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 22, 2026 13:30
@mholwill Malcolm Holwill (mholwill) changed the title GATE-1102: Fix webpackDevServer config for webpack-dev-server v5 compatibility [GATE-1102]: Fix webpackDevServer config for webpack-dev-server v5 compatibility Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates react-scripts’ webpack-dev-server configuration to be compatible with webpack-dev-server v5 by migrating removed v4 options/hooks to their v5 equivalents.

Changes:

  • Replaced removed top-level https devServer option with v5 server option, mapping getHttpsConfig() output appropriately.
  • Migrated v4 onBeforeSetupMiddleware / onAfterSetupMiddleware hooks to the v5 setupMiddlewares API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react-scripts/config/webpackDevServer.config.js
Comment thread packages/react-scripts/config/webpackDevServer.config.js
Comment thread packages/react-scripts/config/webpackDevServer.config.js
Comment thread packages/react-scripts/config/webpackDevServer.config.js
Comment thread packages/react-scripts/config/webpackDevServer.config.js Outdated
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@xalechez Alex Sannikov (xalechez) merged commit 7414212 into main Jun 23, 2026
5 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.

3 participants