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

fix: Don't fetch session during nitro prerender #496

Closed
wants to merge 5 commits into from

Conversation

tesla3327
Copy link
Contributor

During prerendering getSession is currently always called, even on non-protected pages, giving this error: ERROR [nuxt] [request error] [unhandled] [500] fetch failed (http://localhost:3000/api/auth/session?callbackUrl=http://localhost/)

This change just checks if we're prerendering or not, using the x-nitro-prerender header set by Nitro during prerendering.

I found this issue in 0.5.0 but I'm not sure if you're doing patch releases on this or not.

@zoey-kaiser
Copy link
Member

zoey-kaiser commented Jul 26, 2023

Hi @tesla3327

Thank you for your contribution! You said that you tested and I assume found the issue in 0.5.0. Is this also present in 0.6.0? I would assume so, as your contribution is for v0.6!

Please also have a look at the linting issues the CI caught and then we can move on to a proper review!

@zoey-kaiser zoey-kaiser self-requested a review July 26, 2023 14:24
@genu
Copy link
Contributor

genu commented Aug 29, 2023

I can confirm that prerender does throw an error in the latest version as well.

Other than linting, anything else holding this PR back?

@andr-ec
Copy link

andr-ec commented Aug 29, 2023

@zoey-kaiser I'm seeing this as well. Can we accept this?

@zoey-kaiser
Copy link
Member

zoey-kaiser commented Aug 30, 2023

Other than linting, anything else holding this PR back?

At the moment, the linting is the only problem! @genu @andr-ec, does one of you two want to mirror this PR, as the author has sadly not responded in a while? Then we can fix the linting there and move ahead with the merge.

@genu
Copy link
Contributor

genu commented Aug 30, 2023

@zoey-kaiser Done. Have a look at #521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants