Skip to content

Commit 2950186

Browse files
authored
fix(supabase): resolve jsDelivr CDN ESM import failure (#1950)
1 parent a6adb31 commit 2950186

File tree

3 files changed

+21
-91
lines changed

3 files changed

+21
-91
lines changed

deno.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,22 @@
1-
import * as index from '../main/index.js'
2-
const {
3-
PostgrestError,
4-
FunctionsHttpError,
5-
FunctionsFetchError,
6-
FunctionsRelayError,
7-
FunctionsError,
8-
FunctionRegion,
9-
SupabaseClient,
10-
createClient,
11-
GoTrueAdminApi,
12-
GoTrueClient,
13-
AuthAdminApi,
14-
AuthClient,
15-
navigatorLock,
16-
NavigatorLockAcquireTimeoutError,
17-
lockInternals,
18-
processLock,
19-
SIGN_OUT_SCOPES,
20-
AuthError,
21-
AuthApiError,
22-
AuthUnknownError,
23-
CustomAuthError,
24-
AuthSessionMissingError,
25-
AuthInvalidTokenResponseError,
26-
AuthInvalidCredentialsError,
27-
AuthImplicitGrantRedirectError,
28-
AuthPKCEGrantCodeExchangeError,
29-
AuthRetryableFetchError,
30-
AuthWeakPasswordError,
31-
AuthInvalidJwtError,
32-
isAuthError,
33-
isAuthApiError,
34-
isAuthSessionMissingError,
35-
isAuthImplicitGrantRedirectError,
36-
isAuthRetryableFetchError,
37-
isAuthWeakPasswordError,
38-
RealtimePresence,
39-
RealtimeChannel,
40-
RealtimeClient,
41-
REALTIME_LISTEN_TYPES,
42-
REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
43-
REALTIME_PRESENCE_LISTEN_EVENTS,
44-
REALTIME_SUBSCRIBE_STATES,
45-
REALTIME_CHANNEL_STATES,
46-
} = index.default || index
47-
1+
// Direct package re-exports - these work correctly in:
2+
// - Node.js (resolves via node_modules)
3+
// - jsDelivr (bundles with named exports)
4+
// - esm.sh (bundles correctly)
5+
// - Bundlers (webpack, vite, etc.)
6+
export * from '@supabase/auth-js'
7+
export { PostgrestError } from '@supabase/postgrest-js'
488
export {
49-
PostgrestError,
509
FunctionsHttpError,
5110
FunctionsFetchError,
5211
FunctionsRelayError,
5312
FunctionsError,
5413
FunctionRegion,
55-
SupabaseClient,
56-
createClient,
57-
GoTrueAdminApi,
58-
GoTrueClient,
59-
AuthAdminApi,
60-
AuthClient,
61-
navigatorLock,
62-
NavigatorLockAcquireTimeoutError,
63-
lockInternals,
64-
processLock,
65-
SIGN_OUT_SCOPES,
66-
AuthError,
67-
AuthApiError,
68-
AuthUnknownError,
69-
CustomAuthError,
70-
AuthSessionMissingError,
71-
AuthInvalidTokenResponseError,
72-
AuthInvalidCredentialsError,
73-
AuthImplicitGrantRedirectError,
74-
AuthPKCEGrantCodeExchangeError,
75-
AuthRetryableFetchError,
76-
AuthWeakPasswordError,
77-
AuthInvalidJwtError,
78-
isAuthError,
79-
isAuthApiError,
80-
isAuthSessionMissingError,
81-
isAuthImplicitGrantRedirectError,
82-
isAuthRetryableFetchError,
83-
isAuthWeakPasswordError,
84-
RealtimePresence,
85-
RealtimeChannel,
86-
RealtimeClient,
87-
REALTIME_LISTEN_TYPES,
88-
REALTIME_POSTGRES_CHANGES_LISTEN_EVENT,
89-
REALTIME_PRESENCE_LISTEN_EVENTS,
90-
REALTIME_SUBSCRIBE_STATES,
91-
REALTIME_CHANNEL_STATES,
92-
}
14+
} from '@supabase/functions-js'
15+
export * from '@supabase/realtime-js'
16+
17+
// Local exports from CJS build (Node.js can import CJS from ESM)
18+
import main from '../main/index.js'
19+
export const { SupabaseClient, createClient } = main
9320

94-
export default index.default || index
21+
// Default export
22+
export default main

0 commit comments

Comments
 (0)