Hi everyone. I recently tried updating to NextJS v...
# help
c
Hi everyone. I recently tried updating to NextJS v12.1.6 and noticed that
@supabase/supabase-js
can no longer be used in Edge Functions. This is because native NodeJS API's are not supported and it appears there are some dependencies of realtime-js that use these. Here is a look at the stack trace. Has anyone else come across this issue?
Copy code
Module not found: Can't resolve 'fs'

Import trace for requested module:
./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
./pages/api/v0/_middleware.ts

https://nextjs.org/docs/messages/module-not-found

You're using a Node.js module (fs) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime
n
Hello @cdro! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
You might want to post this in Github. I've not seen it mentioned yet.