GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: handle middleware teardown in plugin mode by bjohansebas · Pull Request #5703 · webpack/webpack-dev-server

Conversation

@bjohansebas

@bjohansebas bjohansebas commented Jul 2, 2026

Copy link
Copy Markdown
Member

…n compiler close

Summary

What kind of change does this PR introduce?

Did you add tests for your changes?

Does this PR introduce a breaking change?

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Use of AI

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bjohansebas
fix: handle middleware teardown in plugin mode to prevent TypeError o…
50eeb58
…n compiler close
Copilot AI review requested due to automatic review settings July 2, 2026 21:29
@changeset-bot

changeset-bot Bot commented Jul 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 395b6cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started reviewing on behalf of bjohansebas July 2, 2026 21:30
View session
@codecov

codecov Bot commented Jul 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.54545% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.38%. Comparing base (c2d23a7) to head (395b6cd).

Files with missing lines Patch % Lines
lib/Server.js 94.54% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5703      +/-   ##
==========================================
+ Coverage   82.90%   89.38%   +6.47%     
==========================================
  Files          13       13              
  Lines        6126     6169      +43     
==========================================
+ Hits         5079     5514     +435     
+ Misses       1047      655     -392     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed Jul 2, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes teardown behavior when webpack-dev-server is used in plugin mode (server.apply(compiler)), ensuring compiler.close() does not surface an error due to dev-middleware shutdown semantics in that mode.

Changes:

  • Skip calling webpack-dev-middleware’s close() during Server.stop() when running in plugin mode (this.isPlugin).
  • Add an e2e regression test that asserts compiler.close() completes without returning an error in plugin mode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/e2e/api-plugin.test.js Adds a regression test validating compiler.close() returns no error in plugin mode.
lib/Server.js Avoids calling middleware.close() during teardown when Server is operating as a plugin (apply() mode).

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bjohansebas
bjohansebas marked this pull request as draft July 2, 2026 21:46
bjohansebas added 2 commits July 2, 2026 17:04
@bjohansebas
fix: implement middleware teardown in plugin mode to trigger rebuilds…
1988bba
… correctly
@bjohansebas
test: add callbacks for server.invalidate() in plugin mode
395b6cd
@bjohansebas
bjohansebas marked this pull request as ready for review July 3, 2026 02:59
Copilot AI review requested due to automatic review settings July 3, 2026 02:59
Copilot AI reviewed Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bjohansebas
bjohansebas merged commit a451839 into main Jul 3, 2026
66 of 114 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bjohansebas
bjohansebas deleted the fix-plugin-teardown-middleware-close branch July 3, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@bjohansebas
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.