Hello, I'm trying out Supabase for the first time ...
# help
j
Hello, I'm trying out Supabase for the first time and I've run into an issue... I have a function that I want to do database manipulation from, like this example but an insert() instead of a select(): https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts But running locally I get
error: Module not found "file:///home/deno/functions/_shared/cors.ts".
n
Hello @jpsimons! 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.
j
However that relative path import work must be working in general, because my previous line of
import { supabaseClient } from '../_shared/supabaseClient.ts'
seems to import with no problem. I wonder if "cors" moved locations?
Strike that, I took out the cors import but now I see
error: Module not found "file:///home/deno/functions/_shared/supabaseClient.ts".
seems like it was showing the errors in non-lexical order
g
Do you have the _shared directory in your functions directory?
n
jpsimons (2022-05-05)
j
Oh, I feel dumb, I don't.
Let me copy those in and try
Yep it's all working now. The only minor issue I'm having is getting the the IP address of the request... if deployed, for
x-forwarded-for
I just get 127.0.0.1, and for
x-real-ip
I get null. In local development is seems to give me a real IP address for x-real-ip.
g
If you are asking for help on that, I suggest a new question, but at same time realize, it is a very new feature, and not many may have info for you.
j
Sounds good. Btw I'm making a blog post about how I added simple analytics to my personal site using Supabase, I'll post the link here when that's ready
g
I'm sure SB would appreciate it and a link in showcase maybe is the spot.
n
Thread was archived by @jpsimons. Anyone can send a message to unarchive it.