-
Notifications
You must be signed in to change notification settings - Fork 217
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
feat: allow --unstable flag in functions serve #1139
Conversation
Pull Request Test Coverage Report for Build 5074472686
💛 - Coveralls |
@@ -174,6 +174,11 @@ func Run(ctx context.Context, slug string, envFilePath string, noVerifyJWT *bool | |||
} else { | |||
return fmt.Errorf("failed to check index.ts for function %s: %w", slug, err) | |||
} | |||
|
|||
if *unstable { | |||
denoRunCmd = append(denoRunCmd, "--unstable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried deploying the puppeteer example with supabase functions deploy
? If that works, we can always add the --unstable
flag to deno run by default.
Ideally the same code should work in both local serving and production deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For probably unrelated reasons, the puppeteer example doesn't work locally all for me (even on official cli), there's some issue with readable streams that doesn't occur when running the same with deno run
-
Error: channel closed
at async UserWorker.fetch (ext:sb_user_workers/user_workers.js:54:21)
at async Server.<anonymous> (file:///home/deno/main/index.ts:104:16)
at async Server.#respond (https://deno.land/[email protected]/http/server.ts:220:24)
worker thread panicked Uncaught SyntaxError: The requested module '/v124/[email protected]/esnext/lib/readable-stream-browser.js' does not provide an export named 'default'
at https://esm.sh/v124/[email protected]/esnext/jszip.mjs:2:291
worker "/home/deno/functions/puppeteer" returned an error: Uncaught SyntaxError: The requested module '/v124/[email protected]/esnext/lib/readable-stream-browser.js' does not provide an export named 'default'
at https://esm.sh/v124/[email protected]/esnext/jszip.mjs:2:291
... but since it works great with deno deploy
- https://gqlatxhpnxwuzspuqqvh.functions.supabase.co/puppeteer, and deno bundle
and deno run
both support --unstable
, maybe it could be the default behavior? I just really want to play with Deno KV!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid Deno KV is not currently supported by supabase functions because we are switching to edge-runtime for both serving locally and prod deployment. The --unstable
flag added in this PR targets the legacy deno relay server which we have deprecated.
Please consider opening a github issue with edge runtime repo to help our functions team prioritise Deno KV support.
I will close this PR for now until upstream support is added to edge runtime. |
What kind of change does this PR introduce?
feature
What is the current behavior?
Currently,
supabase functions serve
doesn't allow passing any custom deno flags into its underlingdeno run
command. This change adds an--unstable
flag.fixes supabase/edge-runtime#210
What is the new behavior?
If
--unstable
flag is explicitly added tosupabase functions serve --unstable
, the flag is appended to thedeno run
string before the function path.