Skip to content

fix: handle HTTP module decompression errors - #21890

Closed
OskarEichler wants to merge 1 commit into
webpack:mainfrom
OskarEichler:fix/http-decompression-errors
Closed

fix: handle HTTP module decompression errors#21890
OskarEichler wants to merge 1 commit into
webpack:mainfrom
OskarEichler:fix/http-decompression-errors

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Compressed HTTP module responses could emit an error on the decompressor without reaching the request error handler, leaving compilation unresolved. The selected decompression stream now forwards its first error through the normal callback with URL context.

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

Yes. A real HTTP config case serves invalid gzip data and verifies compilation reports the decompression failure. The focused integration run passes 48 tests, and all lint, generated-output, type, format, spelling, changeset, and diff checks pass.

Does this PR introduce a breaking change?

No. It turns a stalled/error-leaking edge case into the expected module error.

If relevant, did you update the documentation?

A patch changeset documents the corrected failure handling. No public documentation change is required.

Use of AI

Significant AI assistance was used to audit the stream lifecycle and draft the fix and integration regression. I reviewed the final diff and verification results.

Summary by CodeRabbit

  • Bug Fixes
    • Invalid gzip, Brotli, and deflate-compressed HTTP resources are now reported as compilation errors.
    • Decompression errors include the affected URL, making failures easier to identify.
  • Tests
    • Added coverage for invalid gzip responses received through HTTP asset modules.
  • Release
    • Included in a patch release of webpack.

@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 77ec6f5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: c2753115-b885-407e-a0c4-edf53c0bde8a

📥 Commits

Reviewing files that changed from the base of the PR and between 5352fd8 and 77ec6f5.

📒 Files selected for processing (6)
  • .changeset/020-http-uri-decompression-errors.md
  • lib/schemes/HttpUriPlugin.js
  • test/configCases/asset-modules/http-url/errors.js
  • test/configCases/asset-modules/http-url/index.decompression-errors.js
  • test/configCases/asset-modules/http-url/server/index.js
  • test/configCases/asset-modules/http-url/webpack.config.js

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

HttpUriPlugin now propagates gzip, Brotli, and deflate decompression errors with the affected URL. The HTTP URL asset-module tests add malformed gzip coverage and expect a compilation error.

HTTP URI decompression errors

Layer / File(s) Summary
Propagate decompression stream errors
lib/schemes/HttpUriPlugin.js
fetchContentRaw logs decompression failures, appends the URL, and passes the error to the callback.
Validate invalid gzip responses
test/configCases/asset-modules/http-url/*, .changeset/020-http-uri-decompression-errors.md
The test server returns malformed gzip data. A new configuration and entry point exercise the request. The expected error includes the URL. The changeset declares a patch release.

Suggested reviewers: alexander-akait

Merge Risk: ⚪ Minimal · up to 77ec6

Malformed compressed HTTP responses now report a normal compilation error instead of leaving compilation unresolved. The change is localized and merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title uses the valid fix: subject Conventional Commit format and accurately describes the HTTP module decompression error fix. The branch prefix requirement cannot be verified because the branch… Provide the branch name or confirm that its prefix is fix. If it is not, update the title type or branch prefix so both match.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the valid fix: subject Conventional Commit format and accurately describes the HTTP module decompression error fix. The branch prefix requirement cannot be verified because the branch name is not provided.

  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant

Sponsor
SponsoredKunjungi sekarang
Promo