Describe the bug
@supabase/supabase-js@2.106.0 (specifically 2fe1801) introduced an optional OpenTelemetry trace-context propagation feature (packages/shared/tracing/src/extract.ts) that uses a dynamic import('@opentelemetry/api') expression.
The Hermes bytecode compiler (used by all React Native release builds on iOS and Android) does not support dynamic import() and rejects the bundle with error: Invalid expression encountered. The Metro bundle compiles fine, but the subsequent hermesc step fails, breaking the entire release build. 2.105.4 was unaffected.
This means every React Native app that upgrades to @supabase/supabase-js@2.106.0 cannot ship a release build until this is fixed or patched.
Library affected
supabase-js
Reproduction
No response
Steps to reproduce
Tried to make this as "copy and paste" as possible...
- Create Expo App:
npx create-expo-app@latest --template default@sdk-55
- Enter "supabase-js-test-expo" for app name
cd supabase-js-test-expo
npm install @supabase/supabase-js@2.106.0
touch repro.js
- Populate repro.js with:
import { createClient } from "@supabase/supabase-js";
createClient("https://example.supabase.co", "anon-key");
npx expo export:embed --entry-file repro.js --platform ios --dev false --reset-cache --bundle-output main.jsbundle --assets-dest assets-repro --minify false --sourcemap-output main.jsbundle.map
./node_modules/hermes-compiler/hermesc/osx-bin/hermesc -emit-binary -O -out main.hbc main.jsbundle --> fails with error:
main.jsbundle:3552:57: error: Invalid expression encountered
if (otelModulePromise === null) otelModulePromise = import(/* webpackIgnore: true */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Emitted 1 errors. exiting.
The dozens of warning: the variable "X" was not declared lines above the error are normal DOM/Node globals for Hermes-targeted bundles and can be ignored — only the error: line is the bug. On Linux, swap osx-bin for linux64-bin.
- Confirm the previous version is unaffected:
npm install @supabase/supabase-js@2.105.4
- Re-run step 7
- Re-run step 8 --> passes
System Info
System:
OS: macOS 26.4.1
CPU: (12) arm64 Apple M2 Max
Memory: 72.14 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.15.0 - /opt/homebrew/opt/node@24/bin/node
Yarn: 1.22.22 - /opt/homebrew/bin/yarn
npm: 11.12.1 - /opt/homebrew/opt/node@24/bin/npm
pnpm: 11.1.2 - /opt/homebrew/bin/pnpm
bun: 1.3.14 - /opt/homebrew/bin/bun
Deno: 2.1.4 - /opt/homebrew/bin/deno
Browsers:
Chrome: 148.0.7778.96
Edge: 147.0.3912.72
Firefox: 150.0.3
Safari: 26.4
npmPackages:
@supabase/supabase-js: ^2.106.0 => 2.106.0
Used Package Manager
npm
Logs
Full hermesc output on @supabase/supabase-js@2.106.0 (warnings + error)
main.jsbundle:2248:34: warning: the variable "AbortController" was not declared in anonymous function " 69#"
if ("function" == typeof AbortController) return new AbortController();
^~~~~~~~~~~~~~~
main.jsbundle:2400:165: warning: the variable "Promise" was not declared in anonymous arrow function " 93#"
...de.push(() => "readable" === r._state ? Br(r, D) : c(undefined)), q(() => Promise.all(de.map(r => r())), true, D);
^~~~~~~
main.jsbundle:898:32: warning: the variable "queueMicrotask" was not declared in arrow function "y"
if ("function" == typeof queueMicrotask) y = queueMicrotask;else {
^~~~~~~~~~~~~~
main.jsbundle:1146:100: warning: the variable "structuredClone" was not declared in arrow function "ie"
var ie = r => (ie = "function" == typeof r.transfer ? r => r.transfer() : "function" == typeof structuredClone ? r => structuredClone(r, {
^~~~~~~~~~~~~~~
main.jsbundle:2366:84: warning: the variable "self" was not declared in anonymous function " 28#"
var wo = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof global ? global : undefined,
^~~~
main.jsbundle:3552:57: error: Invalid expression encountered
if (otelModulePromise === null) otelModulePromise = import(/* webpackIgnore: true */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.jsbundle:3671:30: warning: the variable "URL" was not declared in function "shouldPropagateToTarget"
if (targetUrl instanceof URL) url = targetUrl;else try {
^~~
main.jsbundle:3495:14: warning: the variable "Deno" was not declared in anonymous function " 235#"
if (typeof Deno !== "undefined") JS_ENV = "deno";else if (typeof document !== "undefined") JS_ENV = "web";else if (typeof navigator !== "undefined" && navig...
^~~~
... (28 more "variable X was not declared" warnings — normal DOM/Node globals for Hermes-targeted bundles)
Emitted 1 errors. exiting.
Origin of the offending expression in main.jsbundle (shows it came from supabase-js's tracing module)
//#endregion
//#region ../../shared/tracing/dist/module/extract.js
var otelModulePromise = null;
var OTEL_PKG = "@opentelemetry/api";
function loadOtel() {
if (otelModulePromise === null) otelModulePromise = import(/* webpackIgnore: true */
/* @vite-ignore */
OTEL_PKG).catch(() => null);
return otelModulePromise;
}
Captured with: grep -n -B6 -A8 'otelModulePromise = import' main.jsbundle
The //#region ../../shared/tracing/dist/module/extract.js comment is emitted by Metro at module boundaries and pinpoints @supabase/supabase-js's tracing module as the source.
Validations
Describe the bug
@supabase/supabase-js@2.106.0(specifically 2fe1801) introduced an optional OpenTelemetry trace-context propagation feature (packages/shared/tracing/src/extract.ts) that uses a dynamicimport('@opentelemetry/api')expression.The Hermes bytecode compiler (used by all React Native release builds on iOS and Android) does not support dynamic
import()and rejects the bundle witherror: Invalid expression encountered. The Metro bundle compiles fine, but the subsequenthermescstep fails, breaking the entire release build.2.105.4was unaffected.This means every React Native app that upgrades to
@supabase/supabase-js@2.106.0cannot ship a release build until this is fixed or patched.Library affected
supabase-js
Reproduction
No response
Steps to reproduce
Tried to make this as "copy and paste" as possible...
npx create-expo-app@latest --template default@sdk-55cd supabase-js-test-exponpm install @supabase/supabase-js@2.106.0touch repro.jsnpx expo export:embed --entry-file repro.js --platform ios --dev false --reset-cache --bundle-output main.jsbundle --assets-dest assets-repro --minify false --sourcemap-output main.jsbundle.map./node_modules/hermes-compiler/hermesc/osx-bin/hermesc -emit-binary -O -out main.hbc main.jsbundle--> fails with error:The dozens of
warning: the variable "X" was not declaredlines above the error are normal DOM/Node globals for Hermes-targeted bundles and can be ignored — only theerror:line is the bug. On Linux, swaposx-binforlinux64-bin.npm install @supabase/supabase-js@2.105.4System Info
System: OS: macOS 26.4.1 CPU: (12) arm64 Apple M2 Max Memory: 72.14 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.15.0 - /opt/homebrew/opt/node@24/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 11.12.1 - /opt/homebrew/opt/node@24/bin/npm pnpm: 11.1.2 - /opt/homebrew/bin/pnpm bun: 1.3.14 - /opt/homebrew/bin/bun Deno: 2.1.4 - /opt/homebrew/bin/deno Browsers: Chrome: 148.0.7778.96 Edge: 147.0.3912.72 Firefox: 150.0.3 Safari: 26.4 npmPackages: @supabase/supabase-js: ^2.106.0 => 2.106.0Used Package Manager
npm
Logs
Full
hermescoutput on@supabase/supabase-js@2.106.0(warnings + error)Origin of the offending expression in
main.jsbundle(shows it came from supabase-js's tracing module)Captured with:
grep -n -B6 -A8 'otelModulePromise = import' main.jsbundleThe
//#region ../../shared/tracing/dist/module/extract.jscomment is emitted by Metro at module boundaries and pinpoints@supabase/supabase-js's tracing module as the source.Validations