diff --git a/packages/astro/src/core/request.ts b/packages/astro/src/core/request.ts index 85e3f5fb35ae..2e77a89c1414 100644 --- a/packages/astro/src/core/request.ts +++ b/packages/astro/src/core/request.ts @@ -70,7 +70,7 @@ export function createRequest({ get() { logger.warn( null, - `\`Astro.request.headers\` is not available in "static" output mode. To enable header access: set \`output: "server"\` or \`output: "hybrid"\` in your config file.` + `\`Astro.request.headers\` is unavailable in "static" output mode, and in prerendered pages within "hybrid" and "server" output modes. If you need access to request headers, make sure that \`output\` is configured as either \`"server"\` or \`output: "hybrid"\` in your config file, and that the page accessing the headers is rendered on-demand.` ); return _headers; }, diff --git a/packages/astro/test/static-build.test.js b/packages/astro/test/static-build.test.js index 126e1011604d..5fc16ca0ace4 100644 --- a/packages/astro/test/static-build.test.js +++ b/packages/astro/test/static-build.test.js @@ -186,7 +186,7 @@ describe('Static build', () => { it('warns when accessing headers', async () => { let found = false; for (const log of logs) { - if (/`Astro\.request\.headers` is not available in "static" output mode/.test(log.message)) { + if (/`Astro\.request\.headers` is unavailable in "static" output mode/.test(log.message)) { found = true; } }