Questions tagged [edge-function]
11 questions
7
votes
4 answers
Nextjs build failing because of jsonwebtoken in _middleware.ts
Would love some help on a Vercel deployment. I created a _middleware.ts file that checks a JWT that a user has in their cookie.
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
import { JwtPayload, verify }…

Dimitri Borgers
- 328
- 4
- 15
4
votes
4 answers
Supabase Edge function says no body was passed
I'm invoking a supabase edge function with the following
async function getData(plan_data){
console.log(plan_data)
console.log(JSON.stringify({plan_data}))
const { data, error } = await…

daredevil
- 53
- 5
3
votes
1 answer
Error when trying to call a supabase edge function
I am trying to call a supabase edge function in javascript but I am getting this error:
access to fetch at 'https:/blablala.functions.supabase.co/hello-world' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to…

Sebastian Trygg
- 47
- 8
2
votes
1 answer
Vercel Deployment Edge Function error: EDGE_FUNCTION_INVOCATION_FAILED
when I'm trying to POST something to my Edge Function on Vercel Deployment I get the following error:
[POST] /api/openai reason=EDGE_FUNCTION_INVOCATION_FAILED, status=500,
user_error=true
TypeError: Illegal invocation at…

Floky99
- 562
- 2
- 8
- 17
2
votes
1 answer
Access supabase database from edge function as admin
I'm coming from Firebase Function... Where I can use the Admin Library to access database from the Function bypassing all security rules? On supabase I didn't yet find a way to do that, the documentation is very scarce. Now I'm using this code to…

Jackson D
- 130
- 6
2
votes
0 answers
GetStream with Supabase via Edge Function -- how to?
I need to write a Supabase Edge Function that interacts with GetStream.
But as Supabase Edge Functions are running via Deno, I am importing the package via JS Deliver as follows:
import { StreamChat } from…

boeledi
- 6,837
- 10
- 32
- 42
2
votes
1 answer
No 'Access-Control-Allow-Origin' header is present error from JS to Cloudflare Workers
I have an edge function in Javascript on Cloudflare Workers. The only thing it does is to check a specific header and return a JSON containing a value accordingly
See code below
async function handleRequest(request) {
const url = new…

NicoCaldo
- 1,171
- 13
- 25
1
vote
1 answer
dart run edge build cloudflare_workers --dev command doesn't work in my project(laptop)
I have installed all tools for this, I couldn't forget something. How to fix this issue?
I did these commands:
vercel build
wrangler dev --local
edge build supabase_functions --dev
All commands are same problem.

Mukhtor
- 13
- 3
0
votes
0 answers
supabase edge function using only js not ts
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…

Lonare
- 3,581
- 1
- 41
- 45
0
votes
1 answer
Nuxt 3, Vercel deploy only one edge function
I have a Nuxt 3 app that I deployed on Vercel. I'm wondering if there's a way to deploy only one of my endpoints as an edge function, while the rest remain as serverless functions. I tried configuring it with 'runtime: "edge"'
export const config =…

Ugur Kellecioglu
- 370
- 1
- 3
- 9
0
votes
1 answer
Supabase edge function running twice, but just one call
I have a relatively simple edge function in typescript at Supabase that connects to our postgres db and runs a query. The function is invoked via an html button. When run locally in the cli, or via production, once deployed, it both cases, the edge…

A Moore
- 181
- 1
- 10