supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
2.86k stars 220 forks source link

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted #941

Closed ghost closed 4 months ago

ghost commented 4 months ago

Bug report

Describe the bug

Supabase-js (^2.38.4) with Next.js (14.0.4, using app router if it matters) is reporting the following error:

 ⚠ ./node_modules/node-gyp-build/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Import trace for requested module:
./node_modules/node-gyp-build/index.js
./node_modules/bufferutil/index.js
./node_modules/websocket/lib/WebSocketFrame.js
./node_modules/websocket/lib/websocket.js
./node_modules/websocket/index.js
./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
./node_modules/@supabase/ssr/dist/index.mjs
./src/hooks/useSupabaseBrowserClient.tsx
./src/components/auth/AuthProvider.tsx

To Reproduce

See also https://github.com/supabase/supabase/issues/20153, but it looks like even a clean/fresh install is reporting this error: https://github.com/supabase/supabase/issues/20153#issuecomment-1879704307.

Expected behavior

It looks like an upstream @supabase-js or @supabase/ssr dependency has an import error.

Screenshots

N/A

System information

Additional context

Other users seem to be experiencing this as well, even on a clean install (see the quoted comments in To Reproduce above).

encima commented 4 months ago

Closing as duplicate of https://github.com/supabase/supabase/issues/20153