Repository navigation
fix: import node:path in the generated Node prerender runner - #289
Merged
Brooooooklyn merged 1 commit intoJul 29, 2026
Merged
Brooooooklyn merged 1 commit into
Brooooooklyn merged 1 commit into
Conversation
Brooooooklyn
approved these changes
Jul 29, 2026
Brooooooklyn
deleted the
07-29-fix_import_node_path_in_the_generated_node_prerender_runner
branch
July 29, 2026 02:13
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.
Fixes #285. Third task of #287.
Problem
runNodePrerenderRunner()writes.void/prerender-runner.mjsinto the consumer app and executes it as a separate Node process. The generated file imported the path library as a bare specifier:Bare specifiers in
<app>/.void/resolve from the application, not from the installedvoidpackage. Under strict pnpm, anytarget: "node"+output: "static"app that doesn't install the path library directly fails:The
pathe→pathslashswap (#288) did not fix this — it only changed the name of the missing package.Fix
The runner only handles local filesystem paths, so it now imports from the Node built-in:
Why CI never caught this
playground/node-staticdeclared the path library (pathe, thenpathslash) as its own devDependency — the exact workaround reported in #285, baked into the test fixture. The runner's bare import always resolved inside the monorepo, sonode-static.test.tsstayed green while every real strict-pnpm consumer broke.This PR removes that dependency so the playground resolves modules like a real consumer app, turning the existing integration test into a genuine regression test for #285. The only in-playground user of
pathslashwas the dev-conveniencescripts/serve-static.mjs, which now usesnode:path(with an oxlint exemption documenting why this playground must not depend onpathslash) — it only builds local fs paths, so no slash normalization is needed.Verification
pathslashdepnode-static.test.tspathslash(no fix)pathslash(no fix)ERR_MODULE_NOT_FOUNDfor the runnernode:path(this PR)Also verified:
vp lintpasses,serve:staticsmoke-tested (serves pages, path-traversal guard intact),voidpackage typecheck passes. The lockfile change is only the dependency removal.