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
Fix env detection for Deno in Supabase Edge Functions #1298
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Looks great!
992abeb
to
4f20f16
Compare
export const isDeno = () => typeof Deno !== "undefined"; | ||
|
||
// Mark not-as-node if in Supabase Edge Function | ||
export const isNode = () => |
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 tried using /* #__PURE__*/
, but without much luck
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.
Great
Closes #1268
It does seem like Supabase Deno Functions only provides a global Deno functions without
versions
property, which will markisDeno
asfalse
and because of NodeJS compat, will markisNode
astrue
.This PR aims to correct both of the properties, which is required to force the
axios-fetch-adapter
in these environments.