0

I am trying to write a supabase edge function with deno.

But I can see that when I run this command.

create edge function

npx supabase functions new FUNCTION-NAME

It creates a function file called index.ts but I am not comfortable with typescript.

Is there a way to create a function with on javascript?

Lonare
  • 3,581
  • 1
  • 41
  • 45
  • 1
    If you can't find a solution here, it's worth noting that TypeScript is a superset of JavaScript. Thus you're okay to write pure JavaScript code inside index.ts. – M0nst3R Aug 25 '23 at 17:14
  • Did you try changing the file's extension to `.js`? If that doesn't work, you can create a new JavaScript module (e.g. `main.js`) and write your code there. Then change the contents of the existing entrypoint module (`index.ts`) to `import "./main.js";` to load and execute it. – jsejcksn Aug 26 '23 at 01:15
  • yes I did and it doesn't work. That is why i am asking the question here. – Lonare Aug 29 '23 at 21:54

0 Answers0