Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning messages when creating a new project with empty template on 4.16.1 #12202

Closed
1 task
ayberktandogan opened this issue Oct 11, 2024 · 3 comments · Fixed by #12206
Closed
1 task

Warning messages when creating a new project with empty template on 4.16.1 #12202

ayberktandogan opened this issue Oct 11, 2024 · 3 comments · Fixed by #12206
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) regression

Comments

@ayberktandogan
Copy link

Astro Info

Astro                    v4.16.1
Node                     v20.17.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

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

No response

Describe the Bug

When creating a new project with default options except the template selected empty, I get the error:

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

I haven't added, changed or removed anything. It just prints this on every refresh.

You can also see the same behaviour on the stackblitz example as well.

What's the expected result?

It should give me no errors because I'm not trying to access "Astro.request.headers" anywhere in the code.

This does not happen on 4.16.0

Link to Minimal Reproducible Example

https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 11, 2024
@matthewmercuri
Copy link
Contributor

I can corroborate this as well. Just tried a fresh install and also on my newly updated existing Astro repo.

@CaptainSwag101
Copy link

I am getting this problem after upgrading my site (created using the built-in blog template in 4.15.1) to 4.16.1 as well. I can't seem to find anywhere in my own code where Astro.request.headers is used, and the error message doesn't give me any useful information as to where or how I might correct this issue without changing to "server" or "hybrid" mode.

@xabru
Copy link

xabru commented Oct 12, 2024

I encountered the same warning again in the latest update "4.16.1" I had to downgrade to "4.16.0" to make the warning disappear in a project created from scratch using bun create astro.

@bluwy bluwy added - P4: important Violate documented behavior or significantly impacts performance (priority) regression and removed needs triage Issue needs to be triaged labels Oct 12, 2024
@bluwy bluwy mentioned this issue Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants