Repository navigation
fix: report queue options and page settings that Void cannot read - #754
Merged
cpojer merged 1 commit intoNov 9, 2026
Merged
Conversation
Void reads these values from the source without running it, and used to skip every form other than `export const name = <literal>` silently. - Queue options exported in another form (re-exports, export lists, let, destructuring) now fail the build instead of deploying Cloudflare's defaults. - Page revalidate, prerender, ssr and layout values that cannot be read are still ignored, but now print a warning. A hard error would break builds that already ship them. - `export * from` in a queue file, page server file or page component prints a warning, including when a comment sits between the tokens. - Svelte instance-script exports are component props, so they are not treated as layout settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Void reads queue consumer options from the source without running it, and only understands
export const name = <literal>. Every other way of exporting the same name is skipped without a message. A queue that shares its options through a module builds and deploys with Cloudflare's defaults:The consumer gets
maxRetries3 andretryDelay0, so a failing message is retried three times without delay instead of being dropped. The same happens with export lists (export { maxRetries }),letandvar, destructuring, andexport * from. The queues guide only says "Export named constants".Page settings are read the same way:
revalidate,prerenderandssrin a page's.server.ts, andlayoutin a page component. There, a computed value is skipped as well: withexport const revalidate = 60 * 60, the page falls back torouting.revalidate.Fix
The shared reader in
shared/static-exports.tsnow also reports the names a scanner asks about that are exported in a form whose value it cannot read, and whether the module usesexport * from. Each scanner decides what to do with them:export * fromin a queue file, a page's.server.tsor a page component prints a warning, since Void cannot tell which names it brings in. The check that decides whether to parse a file skips whitespace and comments, soexport /* shared */ * fromcounts too. A queue file that declares all four options, or a page that declares its own layout, gets no warning: its own exports take precedence..server.ts, that warning also namesloader,action,actionsandgetPrerenderPaths. Page method detection doesn't followexport *either, which affects automatic prerendering, action types and the prerender path list.export let layoutthere is not read as a layout setting and gets no warning. A layout in a later<script module>is still found.Type-only exports are ignored. Values written as
export const name = <literal>are read as before. The cron scanner moves to the new reader without a change in behavior.The queues, revalidation, Pages overview and layouts guides now say that these values must be literals declared with
export constin the file itself.Behavior change: an app that shares queue options through another module now fails to build until each queue file declares them. Those values were never applied.
Tests
packages/void/test/unit/queue-scan.test.ts: re-exports, export lists, a renamed local,letand destructuring fail with the message above.export * fromwarns once, also with a comment or line breaks betweenexportand*. Type-only exports, and a file that declares all four options besideexport *, stay silent.packages/void/test/unit/pages-scan.test.ts: a computedrevalidate, non-booleanprerenderandssr, re-exported, renamed,letand destructured settings, unreadable and non-string layouts, andexport *in server files and components each warn once and keep the default. Type-only exports and a layout declared besideexport *stay silent. A Svelte<script module>or<script context="module">layout after an instance prop namedlayoutis read, and an instance prop alone gets no warning.Each of the 21 new error and warning cases fails without this fix.
Verification
vp test run: 785 files pass, 1 skipped (16,406 tests pass, 30 skipped).vp run check: 33/33 pass.void deployagainst Cloudflare.🤖 Generated with Claude Code