Skip to content

Node 20 deprecation warning emitted in Supabase Edge Functions Deno runtime #2540

Description

@jbar894

Account correction

This is the personal-account continuation of #2539, which was accidentally opened with a different signed-in GitHub account. Please close #2539 as a duplicate of this report.

Bug

A hosted Supabase Edge Function using npm:@supabase/[email protected] logs this warning during worker boot:

Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later.

The function is running on the Supabase Deno-compatible Edge Runtime, not on a user-controlled Node 20 runtime. The invocation still completes successfully with HTTP 200.

Minimal reproduction

import { createClient } from "npm:@supabase/[email protected]";

Deno.serve(() => {
  createClient(
    Deno.env.get("SUPABASE_URL") ?? "",
    Deno.env.get("SUPABASE_ANON_KEY") ?? "",
  );
  return new Response("ok");
});

Deploy this as a hosted Edge Function and invoke it. The warning appears in the function logs when the worker boots.

Expected behavior

The Node deprecation warning should be skipped when Deno is present, since this is a supported Deno runtime and the application cannot upgrade the hosted Node compatibility shim.

Likely cause

shouldShowDeprecationWarning() checks globalThis.process.version without first excluding Deno:

https://github.com/supabase/supabase-js/blob/v2.110.7/packages/core/supabase-js/src/index.ts#L76-L105

Supabase Edge Runtime exposes a Node compatibility process.version of v20.11.1:

https://github.com/supabase/edge-runtime/blob/main/ext/node/polyfills/_process/process.ts#L112-L122

The runtime metadata logic elsewhere in the SDK already checks typeof Deno !== "undefined" before treating the environment as Node. Applying the same distinction to the deprecation guard should avoid the false positive without weakening the real Node warning.

Versions

  • @supabase/supabase-js: 2.110.7
  • Supabase CLI used for deployment: 2.109.0
  • Runtime: hosted Supabase Edge Function, Deno-compatible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions