withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.93k stars 2.49k forks source link

Erroneous warning about `Astro.request.headers` #12496

Closed denschub closed 2 hours ago

denschub commented 6 hours ago

Astro Info

Astro                    v4.16.14
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

The bug described in #12202 happens again. During astro build, there's an erroneous warning:

[WARN] 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.

Despite the code not using Astro.request.headers. This worked in 4.16.13, but in 4.16.14, the warning is back.

What's the expected result?

No warning should be shown. :)

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal?file=README.md

Participation