Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"tinyglobby": "0.2.15",
"tslib": "2.8.1",
"webpack": "5.105.4",
"webpack-dev-middleware": "7.4.5",
"webpack-dev-middleware": "8.0.0",

Choose a reason for hiding this comment

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

high

This update to webpack-dev-middleware v8.0.0 creates a serious mismatch between compile-time types and runtime behavior.

@angular-devkit/build_angular has a direct dependency on webpack-dev-middleware, which appears to be for resolving TypeScript types. With this change, it will resolve to v8.0.0.

However, webpack-dev-server@5.2.3, which is used at runtime, depends on webpack-dev-middleware@^7.0.0. pnpm will correctly provide webpack-dev-server with a v7 release of the middleware, avoiding an immediate runtime crash. This creates a dangerous situation where the code is compiled against v8 types, but runs against a v7 implementation. While this might not break immediately if the used options are compatible, it is a fragile setup.

A key breaking change in webpack-dev-middleware@8.0.0 is that getFilenameFromUrl is now async. webpack-dev-server@5.2.3 uses it synchronously. If for any reason webpack-dev-server resolves to v8 at runtime, it will break.

To avoid this fragility and potential for runtime errors, this dependency should be kept in sync with what webpack-dev-server supports. This update should be reverted until webpack-dev-server officially supports webpack-dev-middleware v8.

Suggested change
"webpack-dev-middleware": "8.0.0",
"webpack-dev-middleware": "7.4.5",

"webpack-dev-server": "5.2.3",
"webpack-merge": "6.0.1",
"webpack-subresource-integrity": "5.1.0"
Expand Down
25 changes: 23 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading