Skip to content

Commit 53949f3

Browse files
authored
feat(repo): remove node-fetch dependency, require Node.js 20+ (#1830)
1 parent 7511686 commit 53949f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1950
-3512
lines changed

.github/workflows/ci-auth-js-node18.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,14 @@ jobs:
220220
actions: read
221221
contents: read
222222

223-
ci-auth-js-node18:
224-
if: ${{ github.event_name == 'push' }}
225-
name: Auth-JS Node.js 18 Compatibility
226-
uses: ./.github/workflows/ci-auth-js-node18.yml
227-
permissions:
228-
actions: read
229-
contents: read
230-
231223
# ==========================================
232224
# CANARY RELEASE (only on master, after all CI passes)
233225
# ==========================================
234226

235227
release-canary:
236228
name: Release Canary
237229
runs-on: ubuntu-latest
238-
needs: [ci-core, ci-supabase-js, ci-auth-js-node18]
230+
needs: [ci-core, ci-supabase-js]
239231
permissions:
240232
contents: read
241233
id-token: write
@@ -244,8 +236,7 @@ jobs:
244236
github.ref == 'refs/heads/master' &&
245237
github.event_name == 'push' &&
246238
needs.ci-core.result == 'success' &&
247-
needs.ci-supabase-js.result == 'success' &&
248-
needs.ci-auth-js-node18.result == 'success'
239+
needs.ci-supabase-js.result == 'success'
249240
steps:
250241
- name: Generate token
251242
id: app-token

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,26 @@
4141

4242
This monorepo contains the complete suite of Supabase JavaScript SDK:
4343

44-
| Library | Description |
45-
| ---------------------------------------------------------- | ---------------------------------------- |
44+
| Library | Description |
45+
| ---------------------------------------------------------- | ------------------------------------- |
4646
| **[@supabase/supabase-js](./packages/core/supabase-js)** | Main isomorphic SDK for Supabase |
4747
| **[@supabase/auth-js](./packages/core/auth-js)** | Authentication SDK |
4848
| **[@supabase/postgrest-js](./packages/core/postgrest-js)** | PostgREST SDK for database operations |
4949
| **[@supabase/realtime-js](./packages/core/realtime-js)** | Real-time subscriptions SDK |
5050
| **[@supabase/storage-js](./packages/core/storage-js)** | File storage SDK |
5151
| **[@supabase/functions-js](./packages/core/functions-js)** | Edge Functions SDK |
5252

53+
## Requirements
54+
55+
- **Node.js 20 or later** (Node.js 18 support was dropped as of October 31, 2025)
56+
- For browser support, all modern browsers are supported
57+
58+
> ⚠️ **Node.js 18 Deprecation Notice**
59+
>
60+
> Node.js 18 reached end-of-life on April 30, 2025. As announced in [our deprecation notice](https://github.com/orgs/supabase/discussions/37217), support for Node.js 18 was dropped on October 31, 2025.
61+
>
62+
> If you must use Node.js 18, please use version `2.x.x` of these libraries where `x` is the last version that supported Node.js 18.
63+
5364
> **💡 Note for Package Users:** If you install and use these packages, **nothing has changed**. Continue installing packages normally:
5465
>
5566
> ```bash

deno.lock

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/MIGRATION.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,91 @@
44
55
> **📦 Note for Package Users:** If you install and use these packages via npm, **nothing changed**. This guide is for contributors who develop and maintain these libraries.
66
7+
---
8+
9+
## 🔴 Node.js 18 Support Dropped
10+
11+
**Effective Date:** October 31, 2025
12+
13+
### What Changed
14+
15+
Starting with version `2.XX.0` (where XX is the version where this change is released), all Supabase JavaScript libraries require **Node.js 20 or later**. The `@supabase/node-fetch` polyfill has been removed, and native fetch support is now required.
16+
17+
### Why?
18+
19+
Node.js 18 reached end-of-life on April 30, 2025, and no longer receives security updates or critical fixes. Node.js 20+ includes native fetch support, eliminating the need for polyfills and reducing bundle size.
20+
21+
### Affected Libraries
22+
23+
- `@supabase/supabase-js`
24+
- `@supabase/auth-js`
25+
- `@supabase/postgrest-js`
26+
- `@supabase/realtime-js`
27+
- `@supabase/storage-js`
28+
- `@supabase/functions-js`
29+
30+
### Migration Guide
31+
32+
**1. Upgrade Node.js** to version 20 or later:
33+
34+
```bash
35+
# Check your current version
36+
node --version
37+
38+
# If < 20.0.0, upgrade Node.js
39+
# Via nvm (recommended):
40+
nvm install 20
41+
nvm use 20
42+
43+
# Or download from https://nodejs.org/
44+
```
45+
46+
**2. Update your package.json** to use the latest version:
47+
48+
```bash
49+
npm install @supabase/supabase-js@latest
50+
# Or for individual packages:
51+
npm install @supabase/auth-js@latest
52+
```
53+
54+
**3. No code changes required** - The APIs remain unchanged. Your existing code will work as-is once you upgrade Node.js.
55+
56+
### Supported Environments
57+
58+
**Node.js 20+** - Native fetch support
59+
**Modern browsers** - Chrome 42+, Firefox 39+, Safari 10.1+, Edge 14+
60+
**Deno 1.0+** - Native fetch built-in
61+
**Bun 0.1+** - Native fetch built-in
62+
**React Native** - With fetch polyfill provided by the framework
63+
**Expo** - With fetch polyfill provided by the framework
64+
65+
### Troubleshooting
66+
67+
**Error: `fetch is not defined`**
68+
69+
This means you're running Node.js < 20. Solutions:
70+
71+
1. Upgrade to Node.js 20+ (recommended)
72+
2. If you absolutely cannot upgrade, use an older version of the libraries (see below)
73+
74+
**Using Node.js 18 (Not Recommended)**
75+
76+
If you must use Node.js 18, install the last version that supported it:
77+
78+
```bash
79+
# Find the last version that supported Node.js 18
80+
# (This will be version 2.XX.X where XX is one less than the version with this change)
81+
npm install @supabase/supabase-js@2.XX.X
82+
```
83+
84+
⚠️ **Warning:** Using Node.js 18 is not recommended as it no longer receives security updates.
85+
86+
### Discussion
87+
88+
For more details, see the [deprecation announcement](https://github.com/orgs/supabase/discussions/37217).
89+
90+
---
91+
792
## 🎯 Who This Guide Is For
893

994
**This guide is for contributors**, including:

nx.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
},
119119
"test:unit": {
120120
"inputs": ["testing", "^production"],
121+
"dependsOn": ["build"],
121122
"cache": true,
122123
"outputs": ["{projectRoot}/coverage"]
123124
},

0 commit comments

Comments
 (0)