Skip to content

Angular application started polluting logs with exception. #830

Closed
@glani

Description

@glani

Bug report

Describe the bug

The simple angular application started polluting logs.

To Reproduce

app.module.ts

in AppModule

export const initializer1 =
  (
  ): (() => Promise<boolean>) =>
    async () => {
      const supabase = createClient(
        'url',
        'key',
        {
          auth: {
            debug: true,
          }
        }
      );
      supabase.auth.onAuthStateChange(() => {});

      return true;
    };


{
      provide: APP_INITIALIZER,
      useFactory: initializer1,
      multi: true,
    },

Expected behavior

No errors in Zone or opportunity to customize showing exceptions.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS, centos
  • Browser chrome
  • Version of supabase-js: [^2.39.12]
  • Version of Node.js: [e.g. 20.10.0]

Additional context

Debug output in the browser console from GoTrue

GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.619Z #_acquireLock begin -1
render-document-frontend-impl.ts:80 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.619Z #onAuthStateChange() registered callback with id 83bf91bd-ddb2-4add-803e-0e3b2cf2b78d
render-document-frontend-impl.ts:89 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.619Z #onAuthStateChange() registered callback with id a347217b-4993-4ee7-af13-921531e6c12e
core.mjs:26656 Angular is running in development mode.
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.643Z #_acquireLock lock acquired for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_initialize() begin is PKCE flow false
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_recoverAndRefresh() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_recoverAndRefresh() session from storage null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_recoverAndRefresh() session is not valid
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_recoverAndRefresh() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_handleVisibilityChange()
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_onVisibilityChanged(true) visibilityState visible
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.644Z #_stopAutoRefresh()
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.645Z #_startAutoRefresh()
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.645Z #_initialize() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.645Z #_acquireLock lock released for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.645Z #_acquireLock end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.645Z #_acquireLock begin -1
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.646Z #_acquireLock begin -1
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.646Z #_acquireLock begin -1
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.658Z #_autoRefreshTokenTick() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.658Z #_acquireLock begin 0
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.690Z #_acquireLock lock acquired for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.690Z #_useSession begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z #__loadSession() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z #getSession() session from storage null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z #__loadSession() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z #_acquireLock lock released for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z INITIAL_SESSION callback id 83bf91bd-ddb2-4add-803e-0e3b2cf2b78d session null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z #_useSession end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.691Z #_acquireLock end
zone.js:1043 Unhandled Promise rejection: Acquiring an exclusive Navigator LockManager lock "lock:sb-guksenxnyizhahqwwusz-auth-token" immediately failed ; Zone: ; Task: null ; Value: Error: Acquiring an exclusive Navigator LockManager lock "lock:sb-guksenxnyizhahqwwusz-auth-token" immediately failed
at locks.js:93:23
at Generator.next ()
at asyncGeneratorStep (asyncToGenerator.js:3:1)
at _next (asyncToGenerator.js:22:1)
at asyncToGenerator.js:27:1
at new ZoneAwarePromise (zone.js:1411:21)
at asyncToGenerator.js:19:1
at locks.js:113:6 Error: Acquiring an exclusive Navigator LockManager lock "lock:sb-guksenxnyizhahqwwusz-auth-token" immediately failed
at https://app.dev.cp.ccwar.io/vendor.js:4186:19
at Generator.next ()
at asyncGeneratorStep (https://app.dev.cp.ccwar.io/vendor.js:92879:24)
at _next (https://app.dev.cp.ccwar.io/vendor.js:92898:9)
at https://app.dev.cp.ccwar.io/vendor.js:92903:7
at new ZoneAwarePromise (https://app.dev.cp.ccwar.io/polyfills.js:1360:21)
at https://app.dev.cp.ccwar.io/vendor.js:92895:12
at https://app.dev.cp.ccwar.io/vendor.js:4206:21
api.onUnhandledError @ zone.js:1043
handleUnhandledRejection @ zone.js:1068
api.microtaskDrainDone @ zone.js:1062
drainMicroTaskQueue @ zone.js:588
Promise.then (async)
nativeScheduleMicroTask @ zone.js:557
scheduleMicroTask @ zone.js:568
resolvePromise @ zone.js:1209
(anonymous) @ zone.js:1100
(anonymous) @ zone.js:1116
asyncGeneratorStep @ asyncToGenerator.js:6
_next @ asyncToGenerator.js:22
(anonymous) @ asyncToGenerator.js:27
ZoneAwarePromise @ zone.js:1411
(anonymous) @ asyncToGenerator.js:19
(anonymous) @ locks.js:113
Show 15 more frames
Show less
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.725Z #_acquireLock end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.725Z auto refresh token tick lock not available
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.745Z #_acquireLock lock acquired for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.745Z #_useSession begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.745Z #__loadSession() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.746Z #getSession() session from storage null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.746Z #__loadSession() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.746Z #_acquireLock lock released for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.746Z INITIAL_SESSION callback id a347217b-4993-4ee7-af13-921531e6c12e session null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.746Z #_useSession end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.746Z #_acquireLock end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #_acquireLock lock acquired for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #_useSession begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #__loadSession() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #getSession() session from storage null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #__loadSession() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #_useSession end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.767Z #_acquireLock lock released for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.768Z #_acquireLock end
VM5217:5407 page lang detection: 3.60888671875 ms
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.864Z #_acquireLock begin -1
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.866Z #_acquireLock begin -1
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #_acquireLock lock acquired for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #_useSession begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #__loadSession() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #getSession() session from storage null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #__loadSession() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #_useSession end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #_acquireLock lock released for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.891Z #_acquireLock end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.893Z #_acquireLock lock acquired for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.893Z #_useSession begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.894Z #__loadSession() begin
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.894Z #getSession() session from storage null
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.894Z #__loadSession() end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.894Z #_useSession end
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.894Z #_acquireLock lock released for storage key sb-guksenxnyizhahqwwusz-auth-token
GoTrueClient.js:131 GoTrueClient@0 (2.62.0) 2023-12-23T09:37:44.894Z #_acquireLock end

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions