You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try supabase.auth.signOut(), on version 2.43.3 on JS, I get this error:
{
"code": 400,
"error_code": "validation_failed",
"msg": "Unsupported logout scope "window""
}
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
In a deployed production environment only, when I run supabase.auth.signOut(), I get the error above. In development, before compiling, it works fine.
See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
System information
OS: [macOS, Windows]
Browser (if applies) [chrome]
Version of supabase-js: [2.43.3]
The text was updated successfully, but these errors were encountered:
I found a solution to the issue. Check your build configuration steps. In my case, I was using Vite.js, which had a global: 'window' transformation configuration. Commenting out that line prevents the global keyword from being transformed into window.
The Supabase-JS client code uses a global object. However, during the Vite.js build, this was being converted to window. In the browser, the window object refers to the document object, which does not contain the global values, leading to the breakage.
Here's the updated configuration:
exportdefaultdefineConfig({define: {// global: 'window',},// other configurations});
This change resolved the issue for me.
If you need further assistance, feel free to ask!
Bug report
Describe the bug
When I try supabase.auth.signOut(), on version 2.43.3 on JS, I get this error:
{
"code": 400,
"error_code": "validation_failed",
"msg": "Unsupported logout scope "window""
}
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
System information
The text was updated successfully, but these errors were encountered: