Comments (23)
Supabase CLI 1.52.3+ should include the Edge Runtime with the fix. cc: @DeanWard @vejja
from edge-runtime.
Wonderful - fixed !
Thanks guys
from edge-runtime.
Additional info :
- broken somewhere between supabase-cli 1.47.5 and 1.50.4
- not solved as of supabase-cli 1.50.8
Linking to supabase-cli as it might be a better place to report
from edge-runtime.
I'm getting this as well. I've also noticed the following behavior. If I send:
OPTIONS http://localhost:54321/functions/v1/function-name
with no headers, the response fails. If I include a body in the options request:
OPTIONS http://localhost:54321/functions/v1/function-name
{
"name": "test"
}
The response succeeds.
from edge-runtime.
I'm also seeing this. Posted about it on Discord
from edge-runtime.
@soedirgo : Not sure whether this is relevant to edge-runtime, but I think DELETE requests also have an empty body.
Anyways many thanks for the fix 🚀
from edge-runtime.
Additional info :
- broken somewhere between supabase-cli 1.47.5 and 1.50.4
- not solved as of supabase-cli 1.50.8
Linking to supabase-cli as it might be a better place to report
supabase-cli 1.48.1 is still working. So it must be between 1.48.1 and 1.50.4
from edge-runtime.
cc @laktek I'm not able to reproduce this bug in the latest main
. Can we close?
from edge-runtime.
@andreespirela Can you try other HTTP verbs like DELETE and confirm everything works without a request body?
from edge-runtime.
@laktek Getting this instead
{
"msg": "Error: channel closed"
}
Investigating.
from edge-runtime.
We are weirdly handling when a request has a body
async fetch(req) {
const { method, url, headers, body, bodyUsed } = req;
const headersArray = Array.from(headers.entries());
const hasBody = false;
const userWorkerReq = {
method,
url,
headers: headersArray,
hasBody,
};
const { requestRid, requestBodyRid } = await ops.op_user_worker_fetch_build(userWorkerReq);
// stream the request body
if (hasBody) {
let writableStream = writableStreamForRid(requestBodyRid);
body.pipeTo(writableStream);
}
const res = await core.opAsync("op_user_worker_fetch_send", this.key, requestRid);
const bodyStream = readableStreamForRid(res.bodyRid);
return new Response(bodyStream, {
headers: res.headers,
status: res.status,
statusText: res.statusText
});
}
hasBody
cc @laktek
from edge-runtime.
We are weirdly handling when a request has a body
Agree - See #69 (comment)
from edge-runtime.
🎉 This issue has been resolved in version 1.2.18 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
from edge-runtime.
I feel like i'm missing something obvious here but I cannot work out how to get my local supabase to use the latest version.
I've updated supabase CLI via homebrew but it's still pulling down edge runtime v1.2.12 from docker, i've manually deleted all the images and allowed supabase to re pull them but it's still pulling the old version.
from edge-runtime.
@DeanWard We haven't updated Supabase CLI to use the latest Edge Runtime yet. Expect a new release today.
from edge-runtime.
@laktek Lakshan - i updated my cli this morning and i only have 1.52.2. when will 1.52.3 be release? thank
from edge-runtime.
@CareTiger 1.52.3 should already be available. Can you try upgrading again?
from edge-runtime.
still doesnt work. serving the request with /home/deno/functions/hello-world Error: channel closed at async Function.create (ext:sb_user_workers/user_workers.js:75:21) at async Server.<anonymous> (file:///home/deno/main/index.ts:94:24) at async Server.#respond (https://deno.land/[email protected]/http/server.ts:220:24)
from edge-runtime.
@laktek supabase --version
1.52.3
from edge-runtime.
@CareTiger Can you share the request you are making? Also, the code for the hello-world
function?
from edge-runtime.
I have filed a ticket. my project reference is zkcmpwzbigjgwiesauro. here is the code ```
// @ts-ignore: module not found
import { serve } from "server";
// @ts-ignore: module not found
import { corsHeaders } from "cors";
// console.log("Hello from Functions!");
serve(async (req: Request) => {
if (req.method === "OPTIONS") {
return new Response("ok", { headers: corsHeaders });
}
const { pathname: path, searchParams: query } = new URL(req.url);
console.log(path);
console.log(req.url);
// get the payload from the request
const payload = await req.json();
console.log(payload.user_id);
return new Response(JSON.stringify(`Hello ${payload.user_id}!`), {
headers: {
...corsHeaders,
},
});
});```
from edge-runtime.
@laktek others are facing the same issue - https://discord.com/channels/839993398554656828/1097177678412533903/1103052379877818419
from edge-runtime.
An update: Looks like @CareTiger's issue was caused due to a bug in CLI handling import maps. Will do a fix for it soon (check the above Discord thread for more details)
from edge-runtime.
Related Issues (20)
- Local Edge functions: event loop error after a few minutes HOT 18
- Edge function segfaults when served by CLI - but not in prod or with `deno run` HOT 3
- Allow fetch unstable APIs in Deno to query a TLS certificate-protected server HOT 2
- TypeError: Deno.memoryUsage is not a function HOT 1
- Official Supabase Puppeteer example does not work locally HOT 2
- supabase serve uses "--no-npm" mode for Deno. Why? This breaks code that needs npm modules. HOT 14
- supabase functions serve runs out of memory and crashes with basic usage HOT 5
- Set CORS headers for Edge Functions 401 response HOT 2
- "An arrow function is not allowed here" on valid TS code HOT 6
- issue with dynamic import in edge function
- error running container: exit 139 HOT 1
- database
- Support jsxImportSource HOT 17
- Error when deploying functions via Github Actions: failed to create task for container. HOT 6
- Get Deno version for edge runtime HOT 8
- Promise.withResolvers is undefined HOT 3
- Import maps don't take NPM modules HOT 1
- npm:[email protected] is not running
- Functions download throwing rust error on windows PC HOT 4
- event loop error HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edge-runtime.