From 1d1c5b2addd35ecb0d2ab49030e9309a5d9efd36 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 16 Jul 2025 17:25:42 -0300 Subject: [PATCH 1/9] fix: add Node 18 deprecation notice --- src/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.ts b/src/index.ts index ff601926..d341f05e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,3 +39,12 @@ export const createClient = < ): SupabaseClient => { return new SupabaseClient(supabaseUrl, supabaseKey, options) } + +// Check for Node.js 18 deprecation +if (typeof process !== 'undefined' && process.version && process.version.startsWith('v18')) { + console.warn( + `⚠️ Node.js 18 is deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` + + `Please upgrade to Node.js 20 or later. ` + + `For more information, visit: https://github.com/orgs/supabase/discussions/37217` + ) +} From 0fc2bbcd64c65073f1809822220e53157a9ce272 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 16 Jul 2025 17:27:08 -0300 Subject: [PATCH 2/9] run pnpm install --- pnpm-lock.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48e88017..1b8aa6ab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,8 +8,8 @@ importers: .: dependencies: '@supabase/auth-js': - specifier: 2.70.0 - version: 2.70.0 + specifier: 2.71.0 + version: 2.71.0 '@supabase/functions-js': specifier: 2.4.5 version: 2.4.5 @@ -17,8 +17,8 @@ importers: specifier: 2.6.15 version: 2.6.15 '@supabase/postgrest-js': - specifier: 1.21.0 - version: 1.21.0 + specifier: 1.19.4 + version: 1.19.4 '@supabase/realtime-js': specifier: 2.11.15 version: 2.11.15 @@ -603,10 +603,10 @@ packages: } engines: { node: '>=16' } - '@supabase/auth-js@2.70.0': + '@supabase/auth-js@2.71.0': resolution: { - integrity: sha512-BaAK/tOAZFJtzF1sE3gJ2FwTjLf4ky3PSvcvLGEgEmO4BSBkwWKu8l67rLLIBZPDnCyV7Owk2uPyKHa0kj5QGg==, + integrity: sha512-OMYNbhGa1Cj4stalJq0VoHm5l7Sj/xY0j9CiYEQCikbQmtiDG3c27EIFA4OD+NxuoHTZmjaW8VJlS3SP+yasEA==, } '@supabase/functions-js@2.4.5': @@ -622,10 +622,10 @@ packages: } engines: { node: 4.x || >=6.0.0 } - '@supabase/postgrest-js@1.21.0': + '@supabase/postgrest-js@1.19.4': resolution: { - integrity: sha512-fqpV5ZwaLVJyQnsmljJF6MnpRWnkjbLEymPylhVo9nFxr6XpkmP0XjRdsDwICBR2ugezoyPYj8yPCrPgSyys3Q==, + integrity: sha512-O4soKqKtZIW3olqmbXXbKugUtByD2jPa8kL2m2c1oozAO11uCcGrRhkZL0kVxjBLrXHE0mdSkFsMj7jDSfyNpw==, } '@supabase/realtime-js@2.11.15': @@ -5587,7 +5587,7 @@ snapshots: '@wallet-standard/base': 1.1.0 '@wallet-standard/features': 1.1.0 - '@supabase/auth-js@2.70.0': + '@supabase/auth-js@2.71.0': dependencies: '@supabase/node-fetch': 2.6.15 @@ -5599,7 +5599,7 @@ snapshots: dependencies: whatwg-url: 5.0.0 - '@supabase/postgrest-js@1.21.0': + '@supabase/postgrest-js@1.19.4': dependencies: '@supabase/node-fetch': 2.6.15 From 815e3143da73800da55b2faf772e35fed70de95e Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Thu, 17 Jul 2025 15:28:29 -0300 Subject: [PATCH 3/9] fix: improve Node 18 deprecation warning and fix import typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add browser environment check to only show Node.js deprecation warning in Node.js - Fix typo in types import path 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index d341f05e..fc0022fa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import SupabaseClient from './SupabaseClient' -import type { GenericSchema, SupabaseClientOptions } from './lib/types' +import type { GenericSchema, SupabaseClientOptions } from './lib/typesz export * from '@supabase/auth-js' export type { User as AuthUser, Session as AuthSession } from '@supabase/auth-js' @@ -41,7 +41,7 @@ export const createClient = < } // Check for Node.js 18 deprecation -if (typeof process !== 'undefined' && process.version && process.version.startsWith('v18')) { +if (typeof window === 'undefined' && typeof process !== 'undefined' && process.version && process.version.startsWith('v18')) { console.warn( `⚠️ Node.js 18 is deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` + `Please upgrade to Node.js 20 or later. ` + From fafd27434d924db89d3aeef13d4b74db3559b879 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Thu, 17 Jul 2025 15:29:57 -0300 Subject: [PATCH 4/9] fix: correct import typo and improve code formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix typo in types import path - Improve formatting of Node.js 18 deprecation warning condition 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index fc0022fa..83986f99 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import SupabaseClient from './SupabaseClient' -import type { GenericSchema, SupabaseClientOptions } from './lib/typesz +import type { GenericSchema, SupabaseClientOptions } from './lib/types' export * from '@supabase/auth-js' export type { User as AuthUser, Session as AuthSession } from '@supabase/auth-js' @@ -41,7 +41,12 @@ export const createClient = < } // Check for Node.js 18 deprecation -if (typeof window === 'undefined' && typeof process !== 'undefined' && process.version && process.version.startsWith('v18')) { +if ( + typeof window === 'undefined' && + typeof process !== 'undefined' && + process.version && + process.version.startsWith('v18') +) { console.warn( `⚠️ Node.js 18 is deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` + `Please upgrade to Node.js 20 or later. ` + From 8390d4a4c8bbfba84a854948c0cce79255eb9a85 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Mon, 21 Jul 2025 09:20:36 -0300 Subject: [PATCH 5/9] feat: add Node.js <= 18 deprecation warning - Add deprecation warning for Node.js versions 18 and below - Extract shouldShowDeprecationWarning function with robust version parsing - Parse major version number from process.version using regex - Handle edge cases: null version, malformed strings, browser environments - Display informative warning message directing users to upgrade to Node.js 20+ - Include link to GitHub discussion for more information --- src/index.ts | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index 83986f99..b0ef3ae4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,15 +40,29 @@ export const createClient = < return new SupabaseClient(supabaseUrl, supabaseKey, options) } -// Check for Node.js 18 deprecation -if ( - typeof window === 'undefined' && - typeof process !== 'undefined' && - process.version && - process.version.startsWith('v18') -) { +// Check for Node.js <= 18 deprecation +function shouldShowDeprecationWarning(): boolean { + if ( + typeof window !== 'undefined' || + typeof process === 'undefined' || + process.version === undefined || + process.version === null + ) { + return false + } + + const versionMatch = process.version.match(/^v(\d+)\./) + if (!versionMatch) { + return false + } + + const majorVersion = parseInt(versionMatch[1], 10) + return majorVersion <= 18 +} + +if (shouldShowDeprecationWarning()) { console.warn( - `⚠️ Node.js 18 is deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` + + `⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` + `Please upgrade to Node.js 20 or later. ` + `For more information, visit: https://github.com/orgs/supabase/discussions/37217` ) From ecb9a9e21c5994719b6e9d4baf282f1d6f68d9e6 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 23 Jul 2025 07:26:32 -0300 Subject: [PATCH 6/9] add engines field in package.json --- package-lock.json | 3 +++ package.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/package-lock.json b/package-lock.json index 092364b4..5b1c801a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,9 @@ "typescript": "^4.5.5", "webpack": "^5.69.1", "webpack-cli": "^4.9.2" + }, + "engines": { + "node": ">=20" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index b1ed7ef1..29f6a02c 100644 --- a/package.json +++ b/package.json @@ -86,5 +86,8 @@ }, "jsdelivr": "dist/umd/supabase.js", "unpkg": "dist/umd/supabase.js", + "engines": { + "node": ">=20" + }, "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" } From af218995ba4cfaff719c30a6e0ee19751801b0a2 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 23 Jul 2025 08:33:31 -0300 Subject: [PATCH 7/9] remove engine --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 29f6a02c..b1ed7ef1 100644 --- a/package.json +++ b/package.json @@ -86,8 +86,5 @@ }, "jsdelivr": "dist/umd/supabase.js", "unpkg": "dist/umd/supabase.js", - "engines": { - "node": ">=20" - }, "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" } From ae0ffbb25c44df90170d3bec445fb2f671a71a48 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 23 Jul 2025 08:33:58 -0300 Subject: [PATCH 8/9] revert pnpm-lock.yaml --- pnpm-lock.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b8aa6ab..48e88017 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,8 +8,8 @@ importers: .: dependencies: '@supabase/auth-js': - specifier: 2.71.0 - version: 2.71.0 + specifier: 2.70.0 + version: 2.70.0 '@supabase/functions-js': specifier: 2.4.5 version: 2.4.5 @@ -17,8 +17,8 @@ importers: specifier: 2.6.15 version: 2.6.15 '@supabase/postgrest-js': - specifier: 1.19.4 - version: 1.19.4 + specifier: 1.21.0 + version: 1.21.0 '@supabase/realtime-js': specifier: 2.11.15 version: 2.11.15 @@ -603,10 +603,10 @@ packages: } engines: { node: '>=16' } - '@supabase/auth-js@2.71.0': + '@supabase/auth-js@2.70.0': resolution: { - integrity: sha512-OMYNbhGa1Cj4stalJq0VoHm5l7Sj/xY0j9CiYEQCikbQmtiDG3c27EIFA4OD+NxuoHTZmjaW8VJlS3SP+yasEA==, + integrity: sha512-BaAK/tOAZFJtzF1sE3gJ2FwTjLf4ky3PSvcvLGEgEmO4BSBkwWKu8l67rLLIBZPDnCyV7Owk2uPyKHa0kj5QGg==, } '@supabase/functions-js@2.4.5': @@ -622,10 +622,10 @@ packages: } engines: { node: 4.x || >=6.0.0 } - '@supabase/postgrest-js@1.19.4': + '@supabase/postgrest-js@1.21.0': resolution: { - integrity: sha512-O4soKqKtZIW3olqmbXXbKugUtByD2jPa8kL2m2c1oozAO11uCcGrRhkZL0kVxjBLrXHE0mdSkFsMj7jDSfyNpw==, + integrity: sha512-fqpV5ZwaLVJyQnsmljJF6MnpRWnkjbLEymPylhVo9nFxr6XpkmP0XjRdsDwICBR2ugezoyPYj8yPCrPgSyys3Q==, } '@supabase/realtime-js@2.11.15': @@ -5587,7 +5587,7 @@ snapshots: '@wallet-standard/base': 1.1.0 '@wallet-standard/features': 1.1.0 - '@supabase/auth-js@2.71.0': + '@supabase/auth-js@2.70.0': dependencies: '@supabase/node-fetch': 2.6.15 @@ -5599,7 +5599,7 @@ snapshots: dependencies: whatwg-url: 5.0.0 - '@supabase/postgrest-js@1.19.4': + '@supabase/postgrest-js@1.21.0': dependencies: '@supabase/node-fetch': 2.6.15 From dd91c262aeca520f42bd2878f5b21e8830e4d174 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 23 Jul 2025 11:01:40 -0300 Subject: [PATCH 9/9] revert package-lock.json --- package-lock.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b1c801a..092364b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,9 +38,6 @@ "typescript": "^4.5.5", "webpack": "^5.69.1", "webpack-cli": "^4.9.2" - }, - "engines": { - "node": ">=20" } }, "node_modules/@ampproject/remapping": {