supabase/supabase-js

2.49.9 breaks application code on Vercel (error 500)

Closed this issue ยท 66 comments

Bug report

Describe the bug

    at (../../../../../node_modules/.pnpm/ws@8.18.2/node_modules/ws/browser.js:4:8)
    at (../../../../../node_modules/.pnpm/@supabase+realtime-js@2.11.9/node_modules/@supabase/realtime-js/src/RealtimeClient.ts:222:20)
    at (../../../../../node_modules/.pnpm/@supabase+realtime-js@2.11.9/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts:218:18)

and the app errors with status 500

To Reproduce

Adding later

Expected behavior

I have updated from 2.49.8

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • Version of supabase-js: [e.g. 2.49.9]
  • Version of Node.js: [e.g. 22.X] (vercel)

Hi @wiesson thank you for reporting the issue, we're working on fix for it, would be great if you could try out the version "@supabase/supabase-js": "2.49.9-next.3" and confirm if that fixed it for you.

Thanks.

I just deployed a version with "@supabase/supabase-js": "2.49.9-next.3", but I have the same error.

Error: ws does not work in the browser. Browser clients must use the native WebSocket object
    at (../../../../../node_modules/.pnpm/ws@8.18.2/node_modules/ws/browser.js:4:8)
    at (../../../../../node_modules/.pnpm/@supabase+realtime-js@2.11.10-next.1/node_modules/@supabase/realtime-js/src/RealtimeClient.ts:222:20)
    at (../../../../../node_modules/.pnpm/@supabase+realtime-js@2.11.10-next.1/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts:218:18)

It works with 2.49.8, so I'm not sure if I'm supposed to change sth

@wiesson can you check with the latest version of supabase-js?

Hey! Seeing this error now:

../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

are you able to provide some example code so we can replica the issue?

also reopening this issue

Will try to create a repro when I get back home later. Here are some additional logs & details in the meantime:

../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/dist/main/index.js
../../node_modules/.pnpm/@supabase+supabase-js@2.49.10/node_modules/@supabase/supabase-js/dist/module/index.js
../../node_modules/.pnpm/@supabase+ssr@0.6.1_@supabase+supabase-js@2.49.10/node_modules/@supabase/ssr/dist/module/createBrowserClient.js
../../node_modules/.pnpm/@supabase+ssr@0.6.1_@supabase+supabase-js@2.49.10/node_modules/@supabase/ssr/dist/module/index.js
./src/lib/supabase/server.ts

Actually now that I look at the import trace it looks like the ssr module is using createBrowserClient under the hood, even for the server client. Here's my supabase/server.ts (copied straight from the docs).

import 'server-only';

import { createServerClient } from '@supabase/ssr';
import type { Database } from 'common/types/database';
import { cookies } from 'next/headers';

export function createClient() {
  const cookieStore = cookies();

  return createServerClient<Database>(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
    {
      cookies: {
        getAll() {
          return cookieStore.getAll();
        },
        setAll(cookiesToSet) {
          try {
            cookiesToSet.forEach(({ name, value, options }) => cookieStore.set(name, value, options));
          } catch {
            // The `setAll` method was called from a Server Component.
            // This can be ignored if you have middleware refreshing
            // user sessions.
          }
        },
      },
    },
  );
}

OK so the repro is literally the official nextjs template: npx create-next-app -e with-supabase.

#1442 might also be related.

Error: ws does not work in the browser. Browser clients must use the native WebSocket object
    at (../../../../../node_modules/.pnpm/ws@8.18.2/node_modules/ws/browser.js:4:8)
    at (../../../../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/src/RealtimeClient.ts:222:20)
    at (../../../../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts:218:18)

Still the same error, is 2.11.10 the correct version to test with?

Yeah, it's the latest version. Honestly, I kinda expected this issue to get more attention, considering it breaks builds...

Edit: it actually doesn't break builds, it compiles with warnings

Edit: it actually doesn't break builds, it compiles with warnings

So true! I've updated the title. I quickly created this so I wouldn't forget to do it

@filipecabaco just wanted to ping you in case you didn't see the repro already

  "scripts": {
    "dev": "next dev --turbopack",
    "dev:webpack": "next dev",
    "build": "next build",
    "start": "next start",
    ... other commands

  },

   "dependencies":{
     ...other libs
    "@supabase/supabase-js": "^2.49.10",
}

With Webpack

$ npm run dev:webpack

> app@0.1.0 dev:webpack
> next dev

โœ” Console Ninja extension is connected to Next.js, see https://tinyurl.com/2vt8jxzw
   โ–ฒ Next.js 15.3.3
   - Local:        http://localhost:3000
   - Network:      http://192.168.3.7:3000
   - Environments: .env.local, .env

 โœ“ Starting...
 โœ“ Ready in 3.7s
 โœ“ Compiled /middleware in 301ms (119 modules)
 โ—‹ Compiling /page/invoices ...
 โš  ./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
./node_modules/@supabase/realtime-js/dist/main/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./src/lib/supabase/server.ts

with Turbopack

$ npm run dev

> app@0.1.0 dev
> next dev --turbopack

โœ” Console Ninja extension is connected to Next.js, see https://tinyurl.com/2vt8jxzw
   โ–ฒ Next.js 15.3.3 (Turbopack)
   - Local:        http://localhost:3000
   - Network:      http://192.168.3.7:3000
   - Environments: .env.local, .env

 โœ“ Starting...
 โœ“ Compiled middleware in 263ms
 โœ“ Ready in 3.3s
 โ—‹ Compiling /page/invoices ...
 โœ“ Compiled /page/invoices in 8.3s
 GET /page/invoices 200 in 9892ms
 โ—‹ Compiling /_not-found/page ...
 โœ“ Compiled /_not-found/page in 1771ms
 GET /.well-known/appspecific/com.chrome.devtools.json 404 in 2375ms
 โ—‹ Compiling /api/auth/get-session-token ...

When I run with webpack with the newest version as of today June 5, 2025, I get that error, but when I run with turbopack I don't get that error.

Then I looked in the code and noticed that it made a curious dynamic import:

            _fetch = (...args) => Promise.resolve(`${'@supabase/node-fetch'}`).then(s => __importStar(require(s))).then(({ default: fetch }) => fetch(...args));

thank you! that's an extremely useful discovery! we might need to do the same fix we did for WS but now one for this fetch lib ๐Ÿ˜“

next.config.ts

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'lh3.googleusercontent.com',
      },
    ],
  },
  webpack: (config) => {
    // Configure webpack to prefer ESM builds for browser environments
    config.resolve.mainFields = ['browser', 'module', 'main'];
    
    // Force webpack to use browser conditions for exports field resolution
    config.resolve.conditionNames = ['browser', 'module', 'import', 'default'];
    
    return config;
  },
};

export default nextConfig;

today: version 2.49.10 works with this nextconfig

i made a PR:
supabase/realtime-js#481

I ask the community for help in analyzing the fetch solution I proposed.

if you consider that new function has strong security implications in spite of being with hardcoded strings, you can ignore it, but if you consider it viable, let me know to upload a new PR

resume:

 /**
   * Use either custom fetch, if provided, or default fetch to make HTTP requests
   *
   * @internal
   */
  _resolveFetch = (customFetch?: Fetch): Fetch => {
    let _fetch: Fetch
    if (customFetch) {
      _fetch = customFetch
    } else if (typeof fetch === 'undefined') {
      _fetch = (...args) => {
        // Try dynamic import with different strategies based on environment
        return this._attemptNodeFetch(args)
      }
    } else {
      _fetch = fetch
    }
    return (...args) => _fetch(...args)
  }

  /**
   * Attempts to load node-fetch with environment-specific strategies
   * @internal
   */
  private async _attemptNodeFetch(args: Parameters<Fetch>): Promise<Response> {
    // Strategy 1: Try new Function() approach (works in most environments)
    try {
      if (this._canUseFunction()) {
        const dynamicImport = new Function(
          'specifier',
          'return import(specifier)'
        )
        const module = await dynamicImport('@supabase/node-fetch')
        return module.default(...args)
      }
    } catch (error) {
      // Continue to next strategy
    }

    // Strategy 2: Direct import (may cause webpack warnings but works in Edge environments)
    try {
      // @ts-ignore - Dynamic import fallback for Edge environments
      const module = await import('@supabase/node-fetch')
      return (module.default as Fetch)(...args)
    } catch (importError) {
      // Continue to next strategy
    }

    // Strategy 3: Fallback to require for legacy Node.js environments
    try {
      if (this._canUseFunction()) {
        const dynamicRequire = new Function(
          'specifier',
          'return require(specifier)'
        )
        const nodeFetch = dynamicRequire('@supabase/node-fetch')
        return Promise.resolve((nodeFetch.default || nodeFetch)(...args))
      } else {
        // Direct require fallback (works in some Node.js environments)
        const nodeFetch = require('@supabase/node-fetch')
        return Promise.resolve((nodeFetch.default || nodeFetch)(...args))
      }
    } catch (requireError) {
      // All strategies failed
      throw new Error(
        'fetch polyfill required: install @supabase/node-fetch or use Node.js 18+. ' +
          'Current environment does not support dynamic imports or require.'
      )
    }
  }

  /**
   * Checks if new Function() is available (CSP restrictions)
   * @internal
   */
  private _canUseFunction(): boolean {
    try {
      new Function('return true')()
      return true
    } catch {
      return false
    }
  }

I'm having this same issue with anything above 2.49.8 using Solid-Start.

Here are my logs when upgrading to either 49.9 or 50:

node_modules/.pnpm/@supabase+supabase-js@2.50.0/node_modules/@supabase/supabase-js/dist/module/SupabaseClient.js (1:16): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+supabase-js@2.50.0/node_modules/@supabase/supabase-js/dist/module/SupabaseClient.js (1:24): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+auth-js@2.70.0/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js (1:13): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+auth-js@2.70.0/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js (1:21): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+functions-js@2.4.4/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js (1:16): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+functions-js@2.4.4/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js (1:24): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+supabase-js@2.50.0/node_modules/@supabase/supabase-js/dist/module/lib/fetch.js (1:16): Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/.pnpm/@supabase+supabase-js@2.50.0/node_modules/@supabase/supabase-js/dist/module/lib/fetch.js (1:24): Error when using sourcemap for reporting an error: Can't resolve original location of error.

2.49.8 works fine though

I also have the Critical dependency: the request of a dependency is an expression warning since very recently.

Adding on that we're seeing Critical dependency: the request of a dependency is an expression with 2.50.0, and that it is causing some realtime subscriptions to fail to receive any payloads.

Revert to 2.49.8 has resolved the problem

I am also getting this same issue in 2.50.0. I have not seen any side-effects yet and it only appears as a warning.

I am also getting these warnings after using 2.50.0. Not seeing any side effects, but it's annoying to see so many warnings each time it gets called. Please let us know once this is fixed.

thank you! that's an extremely useful discovery! we might need to do the same fix we did for WS but now one for this fetch lib ๐Ÿ˜“

Sounds good! Let us know if there's anything we need to do/can do on our side

Same thing for me. Thanks for your effort on this! ๐Ÿ™โค๏ธ

Facing the same issue here:

$ next dev -p 3000
โ–ฒ Next.js 15.3.3

โœ“ Starting...
โœ“ Ready in 1292ms
โœ“ Compiled /middleware in 139ms (244 modules)
โ—‹ Compiling /[schema_name] ...
โš  ./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
./node_modules/@supabase/realtime-js/dist/main/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./utils/supabase/server.ts
./utils/auth.ts
./app/not-found.tsx
โš  ./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
./node_modules/@supabase/realtime-js/dist/main/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./utils/supabase/server.ts
./utils/auth.ts
./app/not-found.tsx

i found that, your key - "anon" or "authenticated" jwt dont change permissions to read data by .select()
so you must add/create policy

Same issue here, "@supabase/supabase-js": "^2.50.0" i get this error on project startup and realtime subscriptions are not firing at all.

../../node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
../../node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
../../node_modules/@supabase/realtime-js/dist/main/index.js
../../node_modules/@supabase/supabase-js/dist/module/index.js
./src/lib/supabase/admin.ts
./src/app/(server)/actions/admin-actions.ts

Tried also with 2.50.1-next.5, the warning goes away but the realtime subscriptions still do not work.

Downgrading to previous versions fixes the issue

Thanks @GBarb0 for reporting that latest next version fixed the warning.

We're working on identifying the issue with realtime subscriptions not firing.

Thanks.

Adding my two cents: I'm trying to build and deploy a pretty straightforward Cloudflare Worker that only uses the sdk to interact with the database.

On 2.50.0 and next, the deploy fails because there's a rogue

if (typeof window === "undefined") {
  WebSocketImpl = require("ws");
} else {
  WebSocketImpl = window.WebSocket;
}

in the build, and the runtime does not like the require.

Downgrading to 2.49.8 fixes the issue.

Same issue here, "@supabase/supabase-js": "^2.50.0" i get this error on project startup and realtime subscriptions are not firing at all.

../../node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
../../node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
../../node_modules/@supabase/realtime-js/dist/main/index.js
../../node_modules/@supabase/supabase-js/dist/module/index.js
./src/lib/supabase/admin.ts
./src/app/(server)/actions/admin-actions.ts

Tried also with 2.50.1-next.5, the warning goes away but the realtime subscriptions still do not work.

Downgrading to previous versions fixes the issue

I have the exact same thing and need to keep it at 2.49.9 for now

Getting the same issue on Next.JS 15.3.4 & supabase-js 2.50.0

./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
./node_modules/@supabase/realtime-js/dist/main/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js

Have the same problem. ๐Ÿ†™

I also have had this issue for a while

We had this issue today too

same

Same issue. Crazy this has been this way for so long with no resolution in sight. Clogging up our logs.

Hi, does anyone have a reproducible sample app I could deploy to make a few tests with latest changes? I wasn't able to reproduce it actually.

Thanks.

Hi, does anyone have a reproducible sample app I could deploy to make a few tests with latest changes? I wasn't able to reproduce it actually.

Thanks.

@grdsdev From the comments it sounds like the Nextjs/Supabase starter template with some code to use the Supabase Broadcast will recreate the problem.

Hey all, could you you please try out using v2.50.1-next.6 and let me know if that fixes your issue?

Thanks.

We all have the same problem with Next.JS 15.3.4 & supabase-js 2.50.0

Iโ€™m having the same issue

 "@supabase/supabase-js": "^2.50.0",
 "next": "15.3.0",

Hey all, could you you please try out using v2.50.1-next.6 and let me know if that fixes your issue?

Thanks.

Works for me! I will do another test alter that day, but looks good so far! <3

Hey all, could you you please try out using v2.50.1-next.6 and let me know if that fixes your issue?

Thanks.

@grdsdev I ran the following npm install @supabase/supabase-js@2.50.1-next.6 and then restarted my Nextjs server and it did NOT solve the problem:

[website]  โš  ../node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
[website] Critical dependency: the request of a dependency is an expression
[website] 
[website] Import trace for requested module:
[website] ../node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
[website] ../node_modules/@supabase/realtime-js/dist/main/index.js
[website] ../node_modules/@supabase/supabase-js/dist/module/index.js
[website] ../node_modules/@supabase/ssr/dist/module/createBrowserClient.js
[website] ../node_modules/@supabase/ssr/dist/module/index.js
[website] ./utils/supabase/server.ts

Did I install correctly?

Hey all, could you you please try out using v2.50.1-next.6 and let me know if that fixes your issue?

Thanks.

I also tried updating as suggested but unfortunately the error persists

jl75 commented

Hey all, could you you please try out using v2.50.1-next.6 and let me know if that fixes your issue?

Thanks.

I had this error too:

../../node_modules/.pnpm/@supabase+realtime-js@2.11.10/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
Critical dependency: the request of a dependency is an expression

v2.50.1-next.6 solved it for me. Would you release a new (intermediate) version back porting the fix?

Hey all, could you you please try out using v2.50.1-next.6 and let me know if that fixes your issue?

Thanks.

Tried this, fixed the issue for me

The fix just got released as v2.50.1.

The fix just got released as v2.50.1.

Confirmed to fix the issue for me in the latest released version

The fix just got released as v2.50.1.

Confirmed fixed for me as well (Vercel / Solid-Start)

The fix just got released as v2.50.1.

Still having issues on Vercel with 2.50.1:

warning "@supabase/realtime-js > isows@1.0.7" has unmet peer dependency "ws@*".

> 1 | import * as WebSocket_ from "ws";
    | ^
  2 | import { getNativeWebSocket } from "./utils.js";
  3 | export const WebSocket = (() => {
  4 |     try {
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js
./node_modules/@supabase/realtime-js/dist/module/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./src/lib/server/supabase.ts
./src/app/api/notifications/route.ts
> Build failed because of webpack errors
error Command failed with exit code 1.

Reverting to 2.49.3, works just fine. I would love to provide more information, but only the Vercel builder is having issues. It works just fine locally...

The realtime issue seems to be back on 2.54.0? I get this error currently:

โš  ./node_modules/.pnpm/@supabase+realtime-js@2.15.0/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/.pnpm/@supabase+realtime-js@2.15.0/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
./node_modules/.pnpm/@supabase+realtime-js@2.15.0/node_modules/@supabase/realtime-js/dist/module/index.js
./node_modules/.pnpm/@supabase+supabase-js@2.54.0/node_modules/@supabase/supabase-js/dist/module/index.js
./src/lib/supabase/service.ts

The realtime issue seems to be back on 2.54.0? I get this error currently:

โš  ./node_modules/.pnpm/@supabase+realtime-js@2.15.0/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
Critical dependency: the request of a dependency is an expression

Import trace for requested module:
./node_modules/.pnpm/@supabase+realtime-js@2.15.0/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
./node_modules/.pnpm/@supabase+realtime-js@2.15.0/node_modules/@supabase/realtime-js/dist/module/index.js
./node_modules/.pnpm/@supabase+supabase-js@2.54.0/node_modules/@supabase/supabase-js/dist/module/index.js
./src/lib/supabase/service.ts

yes

Same, the issue is back indeed.

Hi all! Thank you for chiming in! It seems that my updates on realtime-js are the culprit here. I will try to fix this today! Thank you for your patience!

@vybhavab @RoversX @unav4ila8le just to confirm. What you are seeing is a warning or an error?

@mandarini i see it as a warning but my realtime-js websocket connection doesn't seem to be functioning or connecting to the socket due to the warning

Re-opening until it's in a release

Can you please test with v2.55.0?

Thanks for the prompt fix @mandarini , unfortunately I still see the warning on v2.55.0

I am pasting my next build logs in case they can be useful:

Creating an optimized production build ...
<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (108kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
 โš  Compiled with warnings in 0ms

./node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
A Node.js API is used (process.versions at line: 34) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
./node_modules/@supabase/realtime-js/dist/module/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./supabase/middleware.ts

./node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
A Node.js API is used (process.versions at line: 35) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
./node_modules/@supabase/realtime-js/dist/module/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./supabase/middleware.ts

./node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
A Node.js API is used (process.versions at line: 36) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js
./node_modules/@supabase/realtime-js/dist/module/index.js
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./supabase/middleware.ts

./node_modules/@supabase/supabase-js/dist/module/index.js
A Node.js API is used (process.version at line: 24) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Import trace for requested module:
./node_modules/@supabase/supabase-js/dist/module/index.js
./node_modules/@supabase/ssr/dist/module/createBrowserClient.js
./node_modules/@supabase/ssr/dist/module/index.js
./supabase/middleware.ts

 โœ“ Compiled successfully in 10.0s

Thanks again.

Seems like you're using a too new Node version.

Got it, thanks @harrybawsac
Does that mean Node 20 is the latest supported?

No problem on @supabase/supabase-js@2.55.0, node version v24.5.0, MacOS 15.6

Thank you.

@unav4ila8le no, we will allow you to set a transport mode. writting changelog as we speak so we can guide users properly

@unav4ila8le can you please share a small reproduction repository? I am trying it out in my demo app (https://github.com/mandarini/my-test-sb-proj) and it seems to be working without the problematic logs, that were there before the latest update.

@mandarini I have tested again, and the warning is not triggered on my latest build. I am not sure what changed. Thanks a lot for your support.

@unav4ila8le wow that's so good to hear!!! Thanks for reporting back! And if it ever comes back again, do not hesitate to open a new issue and tag me! :D

Just wanted to add an update here.

After our conversation, I noticed that the problem was still happening intermediately. I couldn't figure out why.

For anyone having the same issue on Next.js, what solved it for me once and for all was changing my runtime from edge to nodejs in my middleware. Next.js just released v15.5 where Node.js runtime support for middleware is now stable.

Hopefully this can help someone, thanks!

FWIW, i was able to get the issue fixed by adding supabase/supabase-js to the serverExternalPackages field in my next.config.js