Title: bug: SSG prerender crashes on dynamic pages with getPrerenderPaths (FetchableDevEnvironment missing hot.api) · Issue #12 · voidzero-dev/void · GitHub
Open Graph Title: bug: SSG prerender crashes on dynamic pages with getPrerenderPaths (FetchableDevEnvironment missing hot.api) · Issue #12 · voidzero-dev/void
X Title: bug: SSG prerender crashes on dynamic pages with getPrerenderPaths (FetchableDevEnvironment missing hot.api) · Issue #12 · voidzero-dev/void
Description: Description collectPrerenderPaths() crashes when resolving dynamic pages that export getPrerenderPaths: TypeError: Cannot read properties of undefined (reading 'outsideEmitter') at Object.connect (vite/dist/node/chunks/fetchableEnvironme...
Open Graph Description: Description collectPrerenderPaths() crashes when resolving dynamic pages that export getPrerenderPaths: TypeError: Cannot read properties of undefined (reading 'outsideEmitter') at Object.connect (...
X Description: Description collectPrerenderPaths() crashes when resolving dynamic pages that export getPrerenderPaths: TypeError: Cannot read properties of undefined (reading 'outsideEmitter') at Object.c...
Opengraph URL: https://github.com/voidzero-dev/void/issues/12
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: SSG prerender crashes on dynamic pages with getPrerenderPaths (FetchableDevEnvironment missing hot.api)","articleBody":"## Description\n\n`collectPrerenderPaths()` crashes when resolving dynamic pages that export `getPrerenderPaths`:\n\n```\nTypeError: Cannot read properties of undefined (reading 'outsideEmitter')\n at Object.connect (vite/dist/node/chunks/fetchableEnvironments.js:10923)\n at new SSRCompatModuleRunner (fetchableEnvironments.js:10978)\n at ssrLoadModule (fetchableEnvironments.js:10957)\n at collectPrerenderPaths (deploy-BBYcX5sX.mjs:760)\n```\n\nOnly affects dynamic pages that export `getPrerenderPaths` — static pages and dynamic pages without it are fine.\n\n## Root Cause\n\n`collectPrerenderPaths()` calls `createServer({ root })` which loads the user's `vite.config.ts` — including `@cloudflare/vite-plugin` with `viteEnvironment: { name: \"ssr\" }`. This replaces the SSR environment with a `FetchableDevEnvironment` (`CloudflareDevEnvironment`).\n\nWhen `ssrLoadModule()` is then called, it creates an `SSRCompatModuleRunner` whose transport unconditionally accesses `environment.hot.api.outsideEmitter`. But `FetchableDevEnvironment`'s hot channel has no `api` property (it's initialized via `normalizeHotChannel({}, ...)` which doesn't add `api`), causing the crash.\n\n### Call chain\n\n1. `ssrLoadModule()` lazily creates `SSRCompatModuleRunner(environment)`\n2. Constructor passes `environment.hot` to `createServerModuleRunnerTransport({ channel: environment.hot })`\n3. Transport's `connect()` accesses `options.channel.api.outsideEmitter.on(...)` — **`api` is `undefined`**\n\n### Why `api` exists on `RunnableDevEnvironment` but not `FetchableDevEnvironment`\n\n- `RunnableDevEnvironment` → `createServerHotChannel()` → creates `api: { innerEmitter, outsideEmitter }`\n- `FetchableDevEnvironment` → `normalizeHotChannel({}, context.hot)` → no `api` property\n\n## Reproduction\n\nPR #10 adds a failing test that reproduces the crash by adding a `posts/[slug]` page to the `static-pages` playground that exports `getPrerenderPaths`.\n\nSee: #10\n\n## Related\n\n- Previously filed upstream as [vitejs/vite#21726](https://github.com/vitejs/vite/issues/21726) (closed) — whether this should also be addressed upstream is an open question, but regardless void should handle this case.","author":{"url":"https://github.com/hyfdev","@type":"Person","name":"hyfdev"},"datePublished":"2026-03-01T11:22:45Z","url":"https://github.com/voidzero-dev/void/issues/12"}
| 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:be4c876f-9aa7-526f-4f4d-c0db3bc7e54e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 975E:146618:4886E1:640D0E:6AFB9EE3 |
| html-safe-nonce | e4a0fd80cf28a5ca1b869d45bdafd62bf759aac132c0d65f51507c5274d05144 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzVFOjE0NjYxODo0ODg2RTE6NjQwRDBFOjZBRkI5RUUzIiwidmlzaXRvcl9pZCI6IjEzMzUxMzA5NzEzMzM5NTkzOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0d13f22e2438f922c0b54278bd12c2397ca13c0fb2ac5ff8679f6b9ad6762bca |
| hovercard-subject-tag | issue:4006960567 |
| 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/12/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a253ca48566af02a2e1789f37ef73b098854c127d4fd387d54ee6b24fa97c9f3/voidzero-dev/void/issues/12 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a253ca48566af02a2e1789f37ef73b098854c127d4fd387d54ee6b24fa97c9f3/voidzero-dev/void/issues/12 |
| og:image:alt | Description collectPrerenderPaths() crashes when resolving dynamic pages that export getPrerenderPaths: TypeError: Cannot read properties of undefined (reading 'outsideEmitter') at Object.connect (... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hyfdev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3cefd19a936819d82cfb5279d50fb56fe79cb9ec30f0f807e04e89b0c58ffae1 |
| 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 | 606800bdb1b81d125fc845bdcc262c9fe063fc8f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width