-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
running supabase functions serve fails. running supabase functions serve <name> causes postgres connection to fail #115
Comments
Thanks for reporting @oldbettie. That would definitely be frustrating having to deploy each time just to test - not at all the intended pattern. I took a look into jszip and it looks like they are doing some advanced import logic with @supabase/edge-functions it's not clear to me why this would work on Deno Deploy but not @oldbettie in the mean time I was able to solve this specific problem by adding import JSZip from 'https://esm.sh/v125/[email protected]?bundle'; which tells esm.sh to bundle all dependencies into a single JS file. Let me know if this helps. |
@gregnr Did the import work when function was deployed to Deno Deploy? Will try to reproduce it. |
everything worked fine when deployed to supabase I am not importing anything for JSZip it seems to be something done under the hood. @gregnr Should I be cloning and running my functions in the edge-runtime rather then the supabase cli? |
I think I might be having a similar issue. Thank you for posting, I hope you're able to get to the bottom of it |
@laktek sorry I didn't actually attempt on Deno Deploy - was making that assumption based on the original post, but I could be wrong. @oldbettie the latest Supabase CLI uses
Do you mind sharing the code you are running? Guessing you have another dependency that imports JSZip. |
here is my import map. I am alse importing serve directly into the functions as it seemed to be a bit faster |
Thanks. Looks like You can try overriding imports to force Edit for future viewers - this works: {
"imports": {
"postgres": "https://deno.land/x/[email protected]/mod.ts",
"puppeteer": "https://deno.land/x/[email protected]/mod.ts"
},
"scopes": {
"https://deno.land/x/[email protected]/vendor/puppeteer-core/vendor/zip/mod.ts": {
"https://esm.sh/[email protected]": "https://esm.sh/[email protected]?bundle"
}
}
} |
I am also experiencing this exact issue. I'm following the example for puppeteer used in the documentation https://supabase.com/docs/guides/functions/examples/screenshots.
However this had no effect, same error. |
@Elodin77 I have just been running the function individually and it seems to work. Bit annoying as I cant test the functions that call other functions locally but at least its something |
Okay found some time to test this out - I was able to get it working using this import map: {
"imports": {
"postgres": "https://deno.land/x/[email protected]/mod.ts",
"puppeteer": "https://deno.land/x/[email protected]/mod.ts"
},
"scopes": {
"https://deno.land/x/[email protected]/vendor/puppeteer-core/vendor/zip/mod.ts": {
"https://esm.sh/[email protected]": "https://esm.sh/[email protected]?bundle"
}
}
} Or if you just want to override {
"imports": {
"postgres": "https://deno.land/x/[email protected]/mod.ts",
"puppeteer": "https://deno.land/x/[email protected]/mod.ts",
"https://esm.sh/[email protected]": "https://esm.sh/[email protected]?bundle"
}
} Worth noting this is a workaround - ideally we find out what's really happening here and see what is different between |
|
Also getting this issue which works on a different project. Went back and used the same function I wrote on another project and I get this error when trying to serve:
|
It's been almost a year. Is there really no official response or at least acknowledgment of this? |
Bug report
Describe the bug
seems like there is an issue with a
deno
package when runningsupabase functions serve
I get this following error.if I run
supabase functions serve <function-name> --env-file supabase/.env
then it will work once but needs to be restarted after every run.seems to only be when done locally. which makes it incrediby frustrating to have to deploy changes everytime we want to test a function.
To Reproduce
start supabase and run
supabase functions serve
Expected behavior
the functions should work
A clear and concise description of what you expected to happen.
the function should execute and hot reload locally as expected. deno seems to be flawed
System information
Additional context
seems like local lambda is still quite buggy.
The text was updated successfully, but these errors were encountered: