Title: Astro: `astro preview` fails after `astro build` in Void apps, and dev restarts can drop the trigger middleware · Issue #419 · voidzero-dev/void · GitHub
Open Graph Title: Astro: `astro preview` fails after `astro build` in Void apps, and dev restarts can drop the trigger middleware · Issue #419 · voidzero-dev/void
X Title: Astro: `astro preview` fails after `astro build` in Void apps, and dev restarts can drop the trigger middleware · Issue #419 · voidzero-dev/void
Description: Problem a. astro preview cannot find the build In an Astro app with void.config.ts: astro build astro preview [ERROR] [@astrojs/cloudflare] No build output found. Run `astro build` before running `astro preview`. The build did write its ...
Open Graph Description: Problem a. astro preview cannot find the build In an Astro app with void.config.ts: astro build astro preview [ERROR] [@astrojs/cloudflare] No build output found. Run `astro build` before running `...
X Description: Problem a. astro preview cannot find the build In an Astro app with void.config.ts: astro build astro preview [ERROR] [@astrojs/cloudflare] No build output found. Run `astro build` before running `...
Opengraph URL: https://github.com/voidzero-dev/void/issues/419
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Astro: `astro preview` fails after `astro build` in Void apps, and dev restarts can drop the trigger middleware","articleBody":"## Problem\n\n### a. `astro preview` cannot find the build\n\nIn an Astro app with `void.config.ts`:\n\n```sh\nastro build\nastro preview\n```\n\n```\n[ERROR] [@astrojs/cloudflare] No build output found. Run `astro build` before running `astro preview`.\n```\n\nThe build did write its output. On exit, Void moves Wrangler's deploy pointer `.wrangler/deploy/config.json` to `.void/`. Void puts it back only when its own Vite plugin runs in preview. Astro's adapter checks the pointer first, and it starts its preview server with `configFile: false`, so Void's plugin never runs there.\n\n```\nastro build ── closeBundle ── on exit: move .wrangler/deploy/config.json to .void/\nastro preview ── adapter: existsSync(.wrangler/deploy/config.json)? no ── \"No build output found\"\n (Void's restore runs only in a Vite preview that loads Void's plugin)\n```\n\nWorkaround: run the build with `VOID_CLOUDFLARE_DEPLOY_BUILD=1`. Void's own Astro integration test does this.\n\n### b. Astro's update check restarts `astro dev` right after \"ready\" (upstream)\n\nWhen Astro's update check is due (a fresh `.astro/` folder, or 12 days since the last check, and not in CI), `astro dev` restarts itself just after it prints \"ready\":\n\n```\n astro v7.3.7 ready in 3531 ms\n...\n03:01:28 Configuration file updated. Restarting...\n```\n\nThe check writes `.astro/settings.json`. The file watcher reports an `add` and a `change`, and Astro's one-time \"ignore the next preferences reload\" flag covers only the first. A request during the restart fails. This is an Astro bug, not a Void bug. Workaround: `ASTRO_DISABLE_UPDATE_CHECK=true`.\n\n### c. After a dev restart, the dev trigger middleware may be removed (unverified)\n\nAfter the restart in (b), Void logged:\n\n```\n[void] Astro middleware already exists. To enable /__void/scheduled and /__void/queue,\n add the Void dev-trigger middleware to your existing onRequest sequence.\n```\n\nVoid had written `src/middleware.ts` itself at the first start. The new plugin instance sees that file, warns, and does not take ownership. The old instance removes the file when its server closes. If that happens, `/__void/scheduled` and `/__void/queue` stop working until `astro dev` restarts. **Only the warning was seen; the removal was not checked.**\n\n## Repro\n\n- a. Astro app with `void.config.ts` and the Cloudflare adapter: `astro build`, then `astro preview`.\n- b. Delete `.astro/`, run `astro dev` outside CI, and watch for \"Configuration file updated. Restarting...\" right after \"ready\".\n- c. After (b), check whether `src/middleware.ts` still exists, and POST to `/__void/scheduled` with the dev trigger token.\n\n## Cause\n\n- a. `packages/void/src/index.ts:125-143`: for Astro, `closeBundle` schedules the pointer move on process exit (`:132-136`). The restore runs only in the plugin's `config` hook in preview (`:114-123`). `@astrojs/cloudflare` 14.3.4 `dist/entrypoints/preview.js:21-25` checks the pointer before it calls Vite's `preview()` with `configFile: false`. Same code on main.\n- b. Astro 7.3.7 `dist/core/dev/update-check.js` (12-day interval, `ASTRO_DISABLE_UPDATE_CHECK`) and `dist/core/dev/restart.js:34-36` (one-time ignore flag).\n- c. `packages/void/src/plugin-framework-triggers.ts:577-608`: `ensureFile` warns when the file exists (`:580`), and `cleanup` removes the file only in the instance that wrote it, on `httpServer` close (`:607`). Vite's `restartServer` creates the new server, then closes the old one. Same code on main.\n\n## Suggested fix\n\n- a. Do not move the pointer after an Astro build. Or restore it from a hook that `astro preview` runs, for example an Astro integration hook.\n- b. Report upstream. Optionally mention `ASTRO_DISABLE_UPDATE_CHECK=true` in the Astro troubleshooting docs.\n- c. Make the middleware file's ownership survive a restart, for example mark the file Void wrote with a header comment and treat a marked file as Void's own. First check that the removal happens.\n\n## Evidence\n\n- a. Seen in a run of the Astro build-and-preview integration test that #413 adds, before the test set `VOID_CLOUDFLARE_DEPLOY_BUILD=1`. Code read at main and the head of #413.\n- b. Seen in a dev log: `.astro/settings.json` reported as `add` then `change`, then the restart. Astro source read.\n- c. Only the warning was seen in the same log. The removal is not verified.\n- Not changed by #413.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nhttps://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH\n","author":{"url":"https://github.com/Brooooooklyn","@type":"Person","name":"Brooooooklyn"},"datePublished":"2026-10-14T04:05:34Z","url":"https://github.com/voidzero-dev/void/issues/419"}
| 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:8fdb4fe6-74fb-abbc-583a-53a1d93858c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C04:648A1:44CC74:5E7D3F:6AFB9C75 |
| html-safe-nonce | e955a9230f681a46309d0169f2f9a37fab79f0a9a074c7b9aaefe5604d70f423 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzA0OjY0OEExOjQ0Q0M3NDo1RTdEM0Y6NkFGQjlDNzUiLCJ2aXNpdG9yX2lkIjoiMzAzMDIxMzAwNDIxMjA1MTA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4d156e26bbd89a80765c432136a8d75a9e8304dcef47dcd666a17def0b642461 |
| hovercard-subject-tag | issue:5841738901 |
| 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/419/issue_layout |
| twitter:image | https://opengraph.githubassets.com/93ada3d56179ada85ee874cfe35d9f4cae4c68f0b21579e295cc374687fde300/voidzero-dev/void/issues/419 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/93ada3d56179ada85ee874cfe35d9f4cae4c68f0b21579e295cc374687fde300/voidzero-dev/void/issues/419 |
| og:image:alt | Problem a. astro preview cannot find the build In an Astro app with void.config.ts: astro build astro preview [ERROR] [@astrojs/cloudflare] No build output found. Run `astro build` before running `... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Brooooooklyn |
| 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