[email protected] ships two dist/server/*.js files that still import a shim via a relative path, which #1006 was meant to eliminate. The same vite:import-analysis failure that #1001 / #1006 fixed is back when running under @cloudflare/sandbox SDK.
Files still wrong in 0.0.46
// dist/server/app-page-boundary-render.js:3
// dist/server/app-page-route-wiring.js:3
import { LayoutSegmentProvider } from "../shims/layout-segment-context.js";
Should be:
import { LayoutSegmentProvider } from "vinext/shims/layout-segment-context";
…matching the pattern #1006 applied to the other 67 imports across 34 files.
Symptom
[plugin:vite:import-analysis] Failed to resolve import
"/workspace/node_modules/vinext/dist/shims/layout-segment-context.js"
from "virtual:vite-rsc/client-in-server-package-proxy/%2Fworkspace%2Fnode_modules%2Fvinext%2Fdist%2Fshims%2Flayout-segment-context.js"
Fires on first paint inside a @cloudflare/sandbox-managed container, every time.
Why plain vinext dev doesn't show it
Vite's optimizeDeps pre-bundles the shim and rewrites the absolute path import to ?v=<hash> form, masking it. Under the @cloudflare/sandbox SDK invocation path the optimizer cache misses, so the raw absolute path reaches import-analysis.normalizeUrl — which treats leading / as URL-relative-to-server-root, so /workspace/foo resolves to <root>/workspace/foo = /workspace/workspace/foo and fails.
Versions
|
|
vinext |
0.0.46 |
@vitejs/plugin-rsc |
^0.5.25 |
vite |
8.0.10 |
@cloudflare/vite-plugin |
^1.35.0 |
@cloudflare/sandbox |
^0.9.2 |
Fix
Apply #1006's transform to those two files. Worth checking why the regression test added in #1006 didn't catch this in CI for 0.0.46.
Reproduce
Zip attached. README inside has the full mechanism walkthrough.
unzip vinext-shim-bug-repro.zip
cd vinext-shim-bug-repro/main
bun install
bun run dev
# open http://localhost:5200/ → click Start sandbox
vinext-shim-bug-repro.zip
[email protected]ships twodist/server/*.jsfiles that still import a shim via a relative path, which #1006 was meant to eliminate. The samevite:import-analysisfailure that #1001 / #1006 fixed is back when running under@cloudflare/sandboxSDK.Files still wrong in 0.0.46
Should be:
…matching the pattern #1006 applied to the other 67 imports across 34 files.
Symptom
Fires on first paint inside a
@cloudflare/sandbox-managed container, every time.Why plain
vinext devdoesn't show itVite's
optimizeDepspre-bundles the shim and rewrites the absolute path import to?v=<hash>form, masking it. Under the@cloudflare/sandboxSDK invocation path the optimizer cache misses, so the raw absolute path reachesimport-analysis.normalizeUrl— which treats leading/as URL-relative-to-server-root, so/workspace/fooresolves to<root>/workspace/foo=/workspace/workspace/fooand fails.Versions
vinext@vitejs/plugin-rsc^0.5.25vite8.0.10@cloudflare/vite-plugin^1.35.0@cloudflare/sandbox^0.9.2Fix
Apply #1006's transform to those two files. Worth checking why the regression test added in #1006 didn't catch this in CI for 0.0.46.
Reproduce
Zip attached. README inside has the full mechanism walkthrough.
vinext-shim-bug-repro.zip