Repository navigation
[vite-plugin] Fix v1 builds when a framework starts a preview server - #16841
Conversation
🦋 Changeset detectedLatest commit: 9a4fdd7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
|
LGTM |
Waku starts a preview server with the same plugin instance during the build, which replaces the build's resolved config with a preview config. Skip the post buildApp work in that case, as 1.68.0 did, instead of asserting.
4e53a75 to
cae21df
Compare
|
Codeowners approval required for this PR:
|
There was a problem hiding this comment.
Superseded by the review of
9a4fdd7d.
This review, of cae21df4
✅ Approved — A small bug fix that brings back the behaviour from before 1.69.0, with a regression test and a changeset. No issues found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The post buildApp hook now returns early when the resolved config is a preview config, instead of asserting. assertIsNotPreview is still used at other places in the file, so the import is still needed. The new test reproduces the case where a framework starts a preview server during the build, and it would fail without the fix.
📝 Documentation: ✅ LGTM
The changeset accurately describes the bug fix. No public documentation changes are needed.
Reviewed commit: cae21df4
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
There was a problem hiding this comment.
✅ Approved — A small bug fix that brings back the behaviour from before 1.69.0. It comes with a regression test and an accurate changeset, and no issues were found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The post buildApp hook in packages/vite-plugin-cloudflare/src/plugins/config.ts now returns early when the resolved config is a preview config, instead of asserting. Other code in the file still calls assertIsNotPreview, so its import is still needed. The new test in build-app.spec.ts starts a preview server with the same plugin instances during the build, and it would fail without the fix.
📝 Documentation: ✅ LGTM
The changeset accurately describes the user-facing fix. No public documentation changes are needed for this bug fix.
Reviewed commit: 9a4fdd7d
Fixes the Waku failures in C3 E2E, e.g. https://github.com/cloudflare/workers-sdk/actions/runs/43073393667/job/130706903895.
Waku's Cloudflare adapter starts a preview server with the same plugin instance during
waku buildto generate static files. That replaces the plugin's resolved config with a preview config, so the postbuildApphook changed in 1.69.0 (#16817) failed withExpected "assets-only" or "workers" plugin config. The hook now skips its work in that case, as it did before 1.69.0.