supabase-js: Acquiring an exclusive Navigator LockManager failed

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Angular throws an error saying ‘Acquiring an exclusive Navigator LockManager lock immediately failed’. This is a new angular project created with the angular version 17. The error is not shown in my other project which is created a month ago.

To Reproduce

  1. Create a new angular project and install ‘@supabase/supabase-js
  2. Create environment files and add key and url of supabase.
  3. add supabaseClient = createClient(environment.url, environment.key) to a component (app component)

Expected behavior

This error should not be thrown and should be able to use all the methods without errors.

Screenshots

Error

System information

  • OS: Windows
  • Browser: Brave v1.61.109
  • Version of supabase-js: 2.39.2
  • Version of Node.js: 20.10.0

Additional context

Could be a duplicate of this issue from gotrue-js. Though I was able to signin using provider ‘google’ I wasn’t able to retrieve session after I signin (throws an error saying Invalid API key) though my api keys and url are correct. I am assuming the error is with storage.

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Reactions: 22
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

If you try to downgrade @supabase/gotrue-js to version 2.61.0 (the previous one), the problem should disappear.

Thank you @Klunk75 for the workaround.

For anyone who wants to fix it temporarily, add this below devDependencies in package.json

"overrides": {
    "@supabase/supabase-js": {
      "@supabase/gotrue-js": "2.61.0"
    }
  }

and run npm i

@vv001 the override worked for me with @supabase/supabase-js@2.40.0 but for version 2.41.1 it seems that gotrue was renamed to authjs and then I updated the override and it worked!

for pnpm:

"overrides": {
    "@supabase/supabase-js>@supabase/auth-js": "2.61.0"
}

and for npm should look like:

"overrides": {
  "@supabase/supabase-js": {
    "@supabase/auth-js": "2.61.0"
  }
}

In case you use pnpm as your dependency manager and you’re facing the same issue, you can fix it by adding the following in your package.json:

"pnpm": {
    "overrides": {
      "@supabase/supabase-js>@supabase/gotrue-js": "2.61.0"
    }
  },

seeing this with supabase 2.39.7, angular 17.2.1

Hi there, I noticed the same problem. After some test I found that the issue should be related to the merge of this Pull Request in @supabase/gotrue-js version 2.62.0: https://github.com/supabase/gotrue-js/pull/807 If you try to downgrade @supabase/gotrue-js to version 2.61.0 (the previous one), the problem should disappear. Please Supabase Team can you check and try to solve this issue? Thank you!

Paolo

@wszgrcy - Yeah, that worked, also not a fan of it being experimental, but seems like v18 will have zoneless coming out next month

@matheo - 2.61.0 doesn’t have the ability to signInAnonymously( )

@ThirzaNL - thanks, I’ll wait for a fix, I can get by for now

I had the same issue as @aroman25 and @wszgrcy , and I’ve solved it using a patch.

Let me preface by saying that I don’t know the inner workings of Supabase at all, and I have not tested it thoroughly, so use it at your own risk.

Basically, it just removes the navigatorLock parts, as that’s seemingly causing the error.

When using this, the override of the package version is no longer needed, besides pinning it to the patched version.

@matheo - thanks! this worked for me and then I updated supabase for the signInAnonymously and now getting this error again, can you work your magic again for the latest @supabase/supabase-js 2.42.5?