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

Confusing hybrid mode on Cookie #7215

Open
jamesli2021 opened this issue Mar 6, 2024 · 4 comments
Open

Confusing hybrid mode on Cookie #7215

jamesli2021 opened this issue Mar 6, 2024 · 4 comments
Labels
help - leave feedback Let's crowd source this one! Looking for comments, suggestions, LGTMs! help wanted Issues looking for someone to run with them! improve documentation Enhance existing documentation (e.g. add an example, improve description)

Comments

@jamesli2021
Copy link
Contributor

📝 Issue Description

Unclear about hybrid mode.

📋 On which page(s) it occurs

https://docs.astro.build/en/guides/server-side-rendering/#on-demand-rendering-features

🤔 Expected Behavior

What do the readers understand from this?

Extract from doc:
In server and hybrid (with opt-out prerender) modes, a page or API endpoint can check, set, get, and delete cookies.

👀 Current Behavior

When I set to output: hybrid in astro config file, the terminal can confusing for newbies, I know we need to opt-out of pre-render. But this warning need to be clear.

4:15:15 [WARN] `Astro.request.headers` is not available in "static" output mode. To enable header access: set `output: "server"` or `output: "hybrid"` in your config file.

🖥️ Browser

NA

📄 Additional Information

No response

@jamesli2021 jamesli2021 added the bug Something on the site isn't working label Mar 6, 2024
@sarah11918
Copy link
Member

Thank you for raising this @jamesli2021 ! I agree and it's actually on my list to convert some of our wording over from "modes" (server, hybrid) to the actual individual pages themselves, because you can have pre-rendered modes in ANY mode, and yes, that is what the error message should be explaining. You might have one of the correct modes configured, but it will only work on a page that's rendered on-demand.

@Princesseuh - I went to look in https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts for this error but I'm having trouble finding it. Is it possible we don't have a docs entry for this one?

In general, I think we'll make a task to do a sweep of SSR related errors and make sure they refer to the specific endpoint/route being prerendered or not, vs the output mode, since that doesn't guarantee that every page uses SSR.

@sarah11918 sarah11918 added improve documentation Enhance existing documentation (e.g. add an example, improve description) help wanted Issues looking for someone to run with them! help - leave feedback Let's crowd source this one! Looking for comments, suggestions, LGTMs! and removed bug Something on the site isn't working labels Mar 18, 2024
@Princesseuh
Copy link
Member

We only have pages for errors, this seems to be a random warning in the console, so it's most likely somewhere random in Astro.

@sarah11918
Copy link
Member

Alright, treasure hunt, it is! Let's find this warning in the Astro code base 😅

@mingjunlu
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help - leave feedback Let's crowd source this one! Looking for comments, suggestions, LGTMs! help wanted Issues looking for someone to run with them! improve documentation Enhance existing documentation (e.g. add an example, improve description)
Projects
None yet
Development

No branches or pull requests

4 participants