-
Notifications
You must be signed in to change notification settings - Fork 129
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
Error 500 on page reload (Cannot use 'in' operator to search for 'catch' in undefined) #89
Comments
this was happening to me too, it was caused when there was no logged in user but something still forces to get user info to do something in my page. So find the thing that forces your user to do something (even console.log(user) can count) and make it conditional. so if it is (console.log(user)), make it (if(user)console.log(user)) |
Hey, I've tried that now too, but unfortunately didn't resolve the problem. |
This happens to me as well, I'm using a simple server middleware to allow incoming api requests, here is a snippet of my code too import { serverSupabaseUser } from '#supabase/server'
export default defineEventHandler(async (event) => {
if (!event.req.url.includes('api') || event.req.url.includes('session')) {
return
}
const user = await serverSupabaseUser(event) // the exception is triggered from this call
if (user?.aud == 'authenticated') {
return
}
throw createError({
statusCode: 401,
statusMessage: 'Unauthorized',
message: 'You have to login to access this path',
})
}) The only solution I found is to signout and sign in again |
I'll be glad if someone can create a repository or a stackblitz with a reproduction scenario 🙏 |
Hi, |
I am getting this, after the session ran out and returning to the still opened browser window/tab. |
Hello! Just to confirm that I also have this bug, on the previous versions and the current one ( |
Can confirm it's working with |
@larbish I think you can use |
Version
@nuxtjs/supabase: 0.2.0 and 0.2.1
nuxt: 3.0.0-rc.12 and 3.0.0-rc.11
Steps to reproduce
I haven't quite figured out how to trigger it yet, but I mostly it happens after you stayed logged in for over a hour without doing anything and then refresh the browser window.
After a 2nd refresh it does work normally again.
What is Expected?
Not to run into a error 500
What is actually happening?
Showing a error 500 on page reload
Does anyone have a idea what could cause it?
I have already reinstalled the node_modules folder and cleared the lock file.
The text was updated successfully, but these errors were encountered: