Repository navigation
fix: resolve island CSS paths and deploy compat flag mismatch - #71
Merged
Merged
Conversation
Brooooooklyn
marked this pull request as draft
April 3, 2026 03:32
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a4b379e38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Two fixes: 1. Island CSS build failure: the island client entry extracted CSS imports from page/layout files verbatim (e.g. `import "./global.css"`), but relative paths don't resolve from the virtual module. Now resolves relative specifiers to absolute paths (with normalizePath for Windows) via a shared rewriteCssImportForVirtualModule helper. Affects all four adapter packages (react, vue, svelte, solid). 2. Deploy compat flag mismatch: the deploy CLI read compatibility settings from the project root's wrangler.json (which typically doesn't exist for void apps), falling back to `nodejs_compat` with an old compat date. But the build output's wrangler.json (generated by @cloudflare/vite-plugin) specifies `nodejs_als` with the correct date. Now falls back to the build output's settings before using hardcoded defaults. Uses the original workerDir (not actualWorkerDir) in framework deploys so bundleEntry() temp dirs don't shadow the plugin-generated config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Brooooooklyn
force-pushed
the
fix/deploy-compat-and-island-css
branch
from
April 3, 2026 04:07
1ef5f54 to
0da594e
Compare
Brooooooklyn
marked this pull request as ready for review
April 3, 2026 04:07
cpojer
added a commit
that referenced
this pull request
Sep 11, 2026
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.


Control flow analysis
Build time (works)
void deployfromplayground/react-pages/vite build, which invokes@cloudflare/vite-plugin@void/reactis a pre-built npm package whose dist imports{ createContext, useContext } from "react"dist/ssr/--index.js+assets/*.jschunksreact-BVLPaBiV.js) shared by all consumers. No dual React.@cloudflare/vite-pluginwritesdist/ssr/wrangler.jsonwithcompatibility_flags: ["nodejs_als"]andcompatibility_date: "2026-03-29"Deploy packaging (the first bug)
readWranglerCompat(root, config)to get compat settings for the deploy manifestwrangler.jsonat the project root (playground/react-pages/) -- does not existworker.compatibility_flagsinvoid.json-- not setcompatibility_date: "2026-02-12",compatibilityFlags: undefineddist/ssr/wrangler.json(which has the correct settings) is never readdist/ssr/into a FormData with the manifestcompatibilityFlags: undefinedServer-side deploy (the second bug)
packages/api/src/routes/deploy.ts) receives the FormDatamanifest.compatibilityFlagsisundefined, the fallback["nodejs_compat"]kicks incompatibility_flags: ["nodejs_compat"](wrong -- should be["nodejs_als"])compatibility_date: "2026-02-12"(wrong -- should be"2026-03-29")Runtime (the crash)
https://void-test-it.void.app/packages/dispatch) routes it to the user's WfP workerindex.jsentry handles the request via HonohandlePageGet(...)which callsrenderPage(pageObj, assetTags)renderToString(element)-- this enters React's server rendererReactSharedInternals.H = serverDispatcherand begins renderingLayoutcomponent runs, callsuseShared()->useContext(SharedContext)useContextinternally doesReactSharedInternals.H.useContext(context)nodejs_compatat compat date2026-02-12on WfP,ReactSharedInternals.Hisnullat this point -- the dispatcher set byrenderToStringis not visible to theuseContextcallnull.useContext->TypeError: Cannot read properties of null (reading 'useContext')Why it works locally
vite dev: No bundling.@void/reactis excluded from dep optimization (optimizeDeps.exclude), so all code shares the same live React module.nodejs_alsis used by the Cloudflare plugin's dev server.wrangler devon build output: Readsdist/ssr/wrangler.jsondirectly, which has the correctnodejs_alsflag and2026-03-29date. The local workerd runtime evaluates modules correctly under these settings.The fix
The deploy pipeline now reads the build output's
wrangler.jsonas a fallback source for compat settings (priority:void.json> projectwrangler.json> build outputwrangler.json> hardcoded default). This ensures the deployed worker runs with the same flags the build was designed for.Also fixes a separate build failure where island CSS imports with relative paths (e.g.
import "./global.css"in a layout) were copied verbatim into the virtual islands-client entry module, where they could not resolve. Now rewrites them to absolute paths.