You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8e41c4e
Browse filesBrowse the repository at this point in the historyBrowse files
Report queue options and page settings that Void cannot read.
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>
Use a whole-number literal such as `3600`. Void reads the value without running the file, so it ignores an expression such as `60 * 60` or a value re-exported from another module, and prints a warning.
65
+
64
66
Per-page values take precedence over `void.config.ts` patterns.
65
67
66
68
A page's `revalidate` export also applies to `routes/` handlers whose URLs match the page pattern. For example, if `pages/[...slug].server.ts` exports `revalidate`, Void can also cache the `GET` response of `routes/now.ts`. Void never caches paths under `/api`. To keep a route handler's response out of the cache, set `x-revalidate: 0` on it. See [Per-response TTL override](#per-response-ttl-override).
Copy file name to clipboardExpand all lines: docs/guide/pages-routing/layouts.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,6 +216,8 @@ A named layout replaces the deepest default layout: in `[root, docs/layout]`, it
216
216
217
217
Void uses the closest matching `_layouts/` file in the page's directory or an ancestor. A missing named layout fails the build.
218
218
219
+
Declare `layout` in the page file itself with a string literal or `false`. Void reads it without running the page, so it ignores a computed or re-exported value and prints a warning.
220
+
219
221
## Shared Data
220
222
221
223
Middleware can inject data available on every page via `c.set("shared", {...})`. Augment `CloudContextVariables` to type the shared data, and `useShared()` will infer the type automatically:
Copy file name to clipboardExpand all lines: docs/guide/pages-routing/overview.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,8 @@ Render and prerender flags combine like this:
153
153
| Island page + `ssr = false`| Invalid. Island pages already use the island renderer. |
154
154
|`output: "static"` + `prerender` unset | Auto-prerender pages that have known paths, including client-only shells. |
155
155
156
+
Write `ssr` and `prerender` as `true` or `false` with `export const` in the `.server.ts` file itself. Void reads them without running the file, so it ignores a computed or re-exported value and prints a warning.
157
+
156
158
### Typed navigation
157
159
158
160
Use the `Link` component for SPA navigation between pages. Build dynamic URLs with [`routeUrl()`](../type-safety.md#typed-urls-and-navigation) to check the route pattern and its parameters:
-`maxRetries`: maximum number of retries before delivery is exhausted (default `3`)
111
111
-`retryDelay`: seconds to wait between retries (default `0`)
112
112
113
+
Declare each option in the queue file with `export const` and a whole-number literal. Void reads these values without running the file, so computed values and options re-exported from another module are not supported. To use the same value in several queues, repeat it in each queue file.
114
+
113
115
Void-managed queues do not configure a dead-letter queue. Cloudflare permanently
114
116
deletes messages that exhaust their retries without one; see
// `export let layout` in a Svelte instance script declares a prop of that name.
142
+
if(script.instance){
143
+
continue;
144
+
}
145
+
exportsAll||=exports.exportsAll;
146
+
if(exports.unreadable.has('layout')){
147
+
ignored??=`pages: layout in '${filename}' is ignored. Declare it in that file as \`export const layout = '<name>'\`; re-exported layouts and other export forms are not read.`;
148
+
}elseif(initializer){
149
+
ignored??=`pages: layout in '${filename}' is ignored. It must be a string literal or \`false\`, such as \`export const layout = 'landing'\`.`;
150
+
}
151
+
}
152
+
if(ignored){
153
+
return{layout: undefined,warnings: [ignored]};
154
+
}
155
+
if(exportsAll){
156
+
return{
157
+
layout: undefined,
158
+
warnings: [
159
+
`pages: '${filename}' uses \`export * from\`. Void does not read a layout export through it, so declare layout in that file with \`export const\`.`,
`pages: ${name} in '${filename}' is ignored. Declare it in that file as \`export const ${name} = ${PAGE_SETTING_PLACEHOLDERS[name]}\`; re-exported settings and other export forms are not read.`,
`pages: revalidate in '${filename}' is ignored. It must be a nonnegative integer literal, such as \`export const revalidate = 3600\`.`,
214
+
);
215
+
}
216
+
}elseif(typeofvalue==='boolean'){
217
+
metadata[name]=value;
218
+
}else{
219
+
metadata.warnings.push(
220
+
`pages: ${name} in '${filename}' is ignored. It must be \`true\` or \`false\`.`,
221
+
);
222
+
}
223
+
}
224
+
if(settings.exportsAll){
225
+
metadata.warnings.push(
226
+
`pages: '${filename}' uses \`export * from\`. Void does not see page exports through it, so export loader, action, actions and getPrerenderPaths by name, and declare revalidate, prerender and ssr in that file with \`export const\`.`,
`queue: ${unreadable} in '${filePath}' must be declared in the queue file as \`export const ${unreadable} = <integer>\`. Re-exported options and other export forms are not read.`,
`queue: '${filePath}' uses \`export * from\`. Void does not read consumer options through it, so declare them in the queue file with \`export const\`. Re-export other names individually to remove this warning.`,
0 commit comments