Created
April 23, 2024 16:47
-
-
Save ThirzaNL/4f263f85fc934a926b8196468e909d4b to your computer and use it in GitHub Desktop.
Supabase Angular v17 temp fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Supabase temporary fix | |
# | |
# Use patch-package for your patching needs. | |
# Put this file in the /patches directory. | |
# | |
# Disclaimer: I do not know of the inner workings | |
# of Supabase, but this does appear to work. | |
# Use at your own risk. | |
# | |
# It removes the navigatorLock as that's seemingly | |
# throwing this error. | |
diff --git a/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js b/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js | |
index 6e471b7..acb7e2b 100644 | |
--- a/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js | |
+++ b/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js | |
@@ -84,9 +84,6 @@ class GoTrueClient { | |
if (settings.lock) { | |
this.lock = settings.lock; | |
} | |
- else if ((0, helpers_1.isBrowser)() && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.locks)) { | |
- this.lock = locks_1.navigatorLock; | |
- } | |
else { | |
this.lock = lockNoOp; | |
} | |
diff --git a/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js b/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js | |
index ef3aa01..5bf22ad 100644 | |
--- a/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js | |
+++ b/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js | |
@@ -6,7 +6,7 @@ import { decodeJWTPayload, Deferred, getItemAsync, isBrowser, removeItemAsync, r | |
import { localStorageAdapter, memoryLocalStorageAdapter } from './lib/local-storage'; | |
import { polyfillGlobalThis } from './lib/polyfills'; | |
import { version } from './lib/version'; | |
-import { LockAcquireTimeoutError, navigatorLock } from './lib/locks'; | |
+import { LockAcquireTimeoutError } from './lib/locks'; | |
polyfillGlobalThis(); // Make "globalThis" available | |
const DEFAULT_OPTIONS = { | |
url: GOTRUE_URL, | |
@@ -79,9 +79,6 @@ export default class GoTrueClient { | |
if (settings.lock) { | |
this.lock = settings.lock; | |
} | |
- else if (isBrowser() && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.locks)) { | |
- this.lock = navigatorLock; | |
- } | |
else { | |
this.lock = lockNoOp; | |
} | |
diff --git a/node_modules/@supabase/auth-js/src/GoTrueClient.ts b/node_modules/@supabase/auth-js/src/GoTrueClient.ts | |
index ec193a6..5bd50a2 100644 | |
--- a/node_modules/@supabase/auth-js/src/GoTrueClient.ts | |
+++ b/node_modules/@supabase/auth-js/src/GoTrueClient.ts | |
@@ -38,7 +38,7 @@ import { | |
import { localStorageAdapter, memoryLocalStorageAdapter } from './lib/local-storage' | |
import { polyfillGlobalThis } from './lib/polyfills' | |
import { version } from './lib/version' | |
-import { LockAcquireTimeoutError, navigatorLock } from './lib/locks' | |
+import { LockAcquireTimeoutError } from './lib/locks' | |
import type { | |
AuthChangeEvent, | |
@@ -205,8 +205,6 @@ export default class GoTrueClient { | |
if (settings.lock) { | |
this.lock = settings.lock | |
- } else if (isBrowser() && globalThis?.navigator?.locks) { | |
- this.lock = navigatorLock | |
} else { | |
this.lock = lockNoOp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment