https://supabase.com/ logo
#help
Title
# help
j

jpsimons

05/05/2022, 9:46 PM
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

Needle

05/05/2022, 9:46 PM
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

jpsimons

05/05/2022, 9:49 PM
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

garyaustin

05/05/2022, 10:26 PM
Do you have the _shared directory in your functions directory?
n

Needle

05/05/2022, 10:26 PM
jpsimons (2022-05-05)
j

jpsimons

05/05/2022, 10:33 PM
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

garyaustin

05/06/2022, 1:39 AM
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

jpsimons

05/06/2022, 1:46 AM
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

garyaustin

05/06/2022, 1:50 AM
I'm sure SB would appreciate it and a link in showcase maybe is the spot.
n

Needle

05/06/2022, 4:18 AM
Thread was archived by @jpsimons. Anyone can send a message to unarchive it.