-
-
Notifications
You must be signed in to change notification settings - Fork 7
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: Invalid UTF-8 sequence crashing Vercel #67
Comments
This is happening to me as well on the production app. Need to degrade the version asap. |
@Nishchit14 which version did you downgrade? I continuously get this error in production too |
@k2xl |
@Nishchit14 @k2xl would you mind adding this option to all of your Supabase client-creation code, to see if it resolves the issue? Keep in mind that this will alter how the cookie is stored; so, if you are grabbing the cookie yourself, somewhere in your code, you'd need to change how that functions. I'm not offering this as a long-term solution, but rather a test. Although, if it's a client option then it could be used long-term. /* example only. this option is needed in all code that creates a client. */
export function createClient() {
return createBrowserClient(process.env.NEXT_PUBLIC_SUPABASE_URL!, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookieEncoding: "raw"
}
)
} Roughly how long is the time between failures? |
Trying and will get back to you |
Still occurs. Happens an hour or so in |
I'm not sure what would be going on then. I went through every source file, and the only references I can find to base64url.js are when cookies are being encoded/decoded to/from base64 (or for tests). And you're sure you added that option in every place that a Supabase client is created? And the error is the same as the original? |
@j4w8n I added it to all the createClients that allow me to pass that cookieEncoding
|
@k2xl that's really strange. Can you verify the cookie is not being stored with a |
Actually the cookies still do begin with base64… |
@k2xl Is this reproducible during dev on your machine, or is it only during prod on Vercel? |
Reproduces on dev and on prod |
Ok... my bad, I wondered why the first part of the cookie was decodeable and others not, so I combined it 😄 (what a hacker I am) anyway, the string was also decodeable. I used this tool to decode: https://base64.guru/converter/decode and I had this warning: The character encoding was detected as “ISO-8859-1”, but the algorithm is inaccurate and there is a high probability that this is wrong. Because of this you can get the wrong results. To know for sure, please check the Character Encoding Detector tool. at the end of the json I had this
this might be the issue |
I "fixed" this for me, by deleting all the cookies and this issue never reappear, BUT i think I have an idea why it was present the first time, if you @Krovikan-Vamp could confirm one of this actions for you too, this will be the issue:
my idea is, if token was 4 cookies long, and is suddently 3 or the other way, it crashes, what makes totally sense IMHO. |
Bug report
Describe the bug
On version
Randomly been getting these errors for my app. Only solution is to destroy my cookies and refresh."@supabase/ssr": "^0.4.0",
Error: Invalid UTF-8 sequence
at (node_modules/@supabase/ssr/dist/module/utils/base64url.js:187:0)
at (node_modules/@supabase/ssr/dist/module/utils/base64url.js:90:0)
at (node_modules/@supabase/ssr/dist/module/cookies.js:246:30)
at (node_modules/@supabase/auth-js/dist/module/lib/helpers.js:100:0)
at (node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:787:0)
at (node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:768:0)
at (node_modules/@supabase/auth-js/dist/module/GoTrueClient.js:714:0)
This us a super weird bug where when I visit my website it just literally crashes. However clearing my cookies the website works for a bit then stops.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
I do not know how the bug occurs.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Running on a nextjs app with supabase. My app allows google logins
The text was updated successfully, but these errors were encountered: