Skip to content

Conversation

@7ttp
Copy link
Contributor

@7ttp 7ttp commented Jan 1, 2026

Summary

Fixes Edge Runtime warnings when using supabase-js in Next.js middleware.

Problem

Next.js static analyzer detects usage of process.versions and process.version in the built output and shows warnings during next build:

  • A Node.js API is used (process.versions at line: 43) which is not supported in the Edge Runtime
  • A Node.js API is used (process.version at line: 389) which is not supported in the Edge Runtime

Solution

Use dynamic property access via globalThis instead of typeof process checks.

The static analyzer cannot trace string-based property access, so it no longer flags these as Node.js API usage.

Before

typeof process !== 'undefined'

After

globalThis['process']

Changes

  • packages/core/realtime-js/src/lib/websocket-factory.ts
  • packages/core/supabase-js/src/index.ts

Related

Closes #1552

@7ttp 7ttp requested review from a team as code owners January 1, 2026 19:18
@7ttp 7ttp force-pushed the fix/edge-runtime-warnings branch from ef06de8 to a6f05bd Compare January 1, 2026 19:24
@mandarini mandarini merged commit d3d05f8 into supabase:master Jan 5, 2026
27 checks passed
@7ttp 7ttp deleted the fix/edge-runtime-warnings branch January 5, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Node.js API is used (process.versions) which is not supported in the Edge Runtime.

2 participants