Title: @void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser · Issue #575 · voidzero-dev/void · GitHub
Open Graph Title: @void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser · Issue #575 · voidzero-dev/void
X Title: @void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser · Issue #575 · voidzero-dev/void
Description: Version: void / @void/react 1.2.1 (also 1.1.12); main at a6de782. Repro pnpm create void (React, static output: output: 'static' in void.config.ts). pages/index.island.tsx: import { Frame } from './_ui/frame'; export default function Hom...
Open Graph Description: Version: void / @void/react 1.2.1 (also 1.1.12); main at a6de782. Repro pnpm create void (React, static output: output: 'static' in void.config.ts). pages/index.island.tsx: import { Frame } from '....
X Description: Version: void / @void/react 1.2.1 (also 1.1.12); main at a6de782. Repro pnpm create void (React, static output: output: 'static' in void.config.ts). pages/index.island.tsx: import { Frame }...
Opengraph URL: https://github.com/voidzero-dev/void/issues/575
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@void/react: a non-island component under an _-prefixed directory in pages/ ships every page module to the browser","articleBody":"**Version:** void / @void/react 1.2.1 (also 1.1.12); `main` at a6de7829.\n\n**Repro**\n1. `pnpm create void` (React, static output: `output: 'static'` in `void.config.ts`).\n2. `pages/index.island.tsx`:\n ```tsx\n import { Frame } from './_ui/frame';\n export default function Home() { return \u003cFrame>\u003ch1>Hello\u003c/h1>\u003c/Frame>; }\n ```\n3. `pages/_ui/frame.tsx`, a shared server-only component that is not a page or an island:\n ```tsx\n export const SECRET_COPY = 'server-only text';\n export function Frame({ children }: { children: React.ReactNode }) {\n return \u003cmain data-x={SECRET_COPY}>{children}\u003c/main>;\n }\n ```\n4. `vp build`, then `ls dist/client/assets` and `grep -l 'server-only text' dist/client/assets/*.js`.\n\n**Expected:** an island-only app emits no `pages-client` bundle, and `frame.tsx` (not a route, because the route scanner skips `_` segments) never reaches `dist/client`.\n\n**Actual:** `pages-client-*.js` plus a chunk for every page module and every import (`frame-*.js`) are emitted to `dist/client/assets`, and the server-only strings are in them. In our app that is 18 files and 351 KB instead of 5 files and 33 KB, and 42 strings that were meant to stay server-side.\n\n**Cause:** `packages/react/src/plugin-pages.ts` `hasNonIslandPages()` skips only basenames that start with `_`:\n```ts\nif (name.startsWith('_') || name.startsWith('layout.')) continue;\n```\n`entry.name` for `pages/_ui/frame.tsx` is `frame.tsx`. The pages scanner (`scan.ts`) skips any segment that starts with `_` (except `_layouts`), so the two disagree. The Solid plugin has the same check.\n\n**Suggested fix:** test every path segment relative to `dir`, as the scanner does:\n```ts\nconst rel = relative(dir, join(entry.parentPath, name));\nif (rel.split(sep).some((s) => s.startsWith('_')) || name.startsWith('layout.')) continue;\n```\nThis is adjacent to #559, which adds the `.server.` exclusion to the same line.\n","author":{"url":"https://github.com/gopalpatel","@type":"Person","name":"gopalpatel"},"datePublished":"2026-10-24T13:32:14Z","url":"https://github.com/voidzero-dev/void/issues/575"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6e4b6902-e191-670b-65ee-110ef472c01a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9904:33F13D:A5259C:E214E1:6AFBDD30 |
| html-safe-nonce | 5cec172feac1aa7cdd444a1b5b70a8a672803be3cb16cc98cf44beadbabdee9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTA0OjMzRjEzRDpBNTI1OUM6RTIxNEUxOjZBRkJERDMwIiwidmlzaXRvcl9pZCI6IjY5MTQzMjkwMTE0ODY2MzA4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5cfaa2394b89fd73bfc03c86483093764ae4e48665e7212ea7da6b1de1af2bb7 |
| hovercard-subject-tag | issue:6013467663 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/voidzero-dev/void/575/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc048a86e34583747d6499358d4de3e808d8bc48272305762fbe0ba69f897edf/voidzero-dev/void/issues/575 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc048a86e34583747d6499358d4de3e808d8bc48272305762fbe0ba69f897edf/voidzero-dev/void/issues/575 |
| og:image:alt | Version: void / @void/react 1.2.1 (also 1.1.12); main at a6de782. Repro pnpm create void (React, static output: output: 'static' in void.config.ts). pages/index.island.tsx: import { Frame } from '.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gopalpatel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec |
| turbo-cache-control | no-preview |
| go-import | github.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git |
| octolytics-dimension-user_id | 149750581 |
| octolytics-dimension-user_login | voidzero-dev |
| octolytics-dimension-repository_id | 1164437080 |
| octolytics-dimension-repository_nwo | voidzero-dev/void |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1164437080 |
| octolytics-dimension-repository_network_root_nwo | voidzero-dev/void |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | df859c48a4c8b4c0009c19bb4e82101aacb4b998 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width