How to share code between edge functions and nextjs app?
Let's say I have supabase js queries I use in my nextjs app, but also in my edge functions. I want to share the code between the two, but the issue is that the deno edge functions import supabasjs with the deno import, while the nextjs app does it with a directly installed npm package. When I try to build the nextjs app when using code inside of my supabase/functions folder, the build fails. Any way to make this work?
3 Replies
I punted the whole problem by not using Supabase edge functions and just implementing my API inside Next.js.
lol sad
i hope supabase realizes how sad it is that you can't share code between your app and the edge functions
this is a use case for a npm package. you can import npm packages into deno
put your shared code in a package then import into both projects