Upgrade to Vite 7 (breaking change) #3417
Open
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.
WHY are these changes introduced?
Fixes #3263
The
@shopify/mini-oxygenpackage is incompatible with Vite 7.x due to SSR implementation differences, causingReferenceError: __vite_ssr_exportName__ is not defined. This blocks developers from using Vite 7.Vite 7 introduces breaking changes to the Module Runner API:
ssrExportNameKeyas a 6th parameter to the SSR contextgetBuiltins()invoke methodrootoption from ModuleRunnerOptionsWHAT is this pull request doing?
Core changes to
@shopify/mini-oxygen(src/vite/worker-entry.ts):ssrExportNameKey(new 6th parameter in Vite 7)runInlinedModuleto use 6 parameters matching Vite 7's esmEvaluatorgetBuiltins()invoke methodRemoved deprecated feature (
server-middleware.ts):__VITE_ROOTbinding (deprecated in Vite 7)Package updates:
@shopify/mini-oxygen^7.0.0, Node>=20.19.0@shopify/cli-hydrogen^7.0.0, Vitest^3.2.4@shopify/hydrogen^7.0.0@shopify/hydrogen-react^7.0.0templates/skeleton^7.0.0>=20.19.0, Vite override^7.0.0Test updates:
build.test.ts: Updated assertions for Vite 7's changed output messagesHOW to test your changes?
Run mini-oxygen tests:
npm test -- --filter=@shopify/mini-oxygenExpected: 47 tests pass
Build the skeleton template:
Expected: Successful build
Run cli-hydrogen tests:
npm test -- --filter=@shopify/cli-hydrogenExpected: 297/298 pass (1 pre-existing failure unrelated to Vite 7)
Checklist