fix: support relocated client-mode build outputs - #386
Closed
everton-dgn wants to merge 2 commits into
Closed
everton-dgn wants to merge 2 commits into
everton-dgn wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 4dab536 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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Client-mode prerender imported
dist/server/server.jsand wrote the shell todist/client, even when a host such as Nitro relocated both outputs. These builds failed withERR_MODULE_NOT_FOUND; applications without server functions also discarded the service before the host could consume it.Use the resolved and emitted environment directories for prerender and preview. Retain the SSR service for host build orchestrators, including applications without server functions. Standalone client builds keep their static-only output. Align the preview SSR default with build, and limit standalone cleanup to an SSR directory strictly inside the project root that cannot contain client output. Log a warning when an unsafe target prevents that cleanup.
Add real production-build/HTTP regression coverage for relocated outputs, explicit SSR output configuration and both client/SSR modes. Test unsafe cleanup targets by observing the existing hook without executing removal. Each test runs in its own fixture sandbox and sends its artifacts to the trash on success or failure, using a development-only dependency. The host proof closes its preview server in
finally. Update the client-mode README and add a patch changeset.Closes #381.
Validation:
node_modules, so the fixture exercises the application's transform pipeline. An SSR metadata assertion fails when the former dependency-path sandbox is restored and passes in both miniature SSR modes and Nitro SSR.The broader SSR suite ran on an earlier candidate with 583/586 passing; the failing preview/base modes passed after correction, and authored entries passed on an isolated repeat. The full broader suite was not repeated on the final candidate or this follow-up. Existing whole-file formatting differences remain outside this fix. Tests ran on Node 24.21.0; the cleanup dependency's Node >=20 requirement is compatible with the project's >=22.12.0 minimum. No other Nitro preset, Vite version or operating system was tested.