Non technical trying to deploy edge function via dashboard without success

Hello, I am using supabase with Bolt to code an app. However, Bolt tells me one of my edge functions is too big for it to deploy it, so he tells me to do it manually. So I copied the function code, went to my Supabase edge function online dashboard, clicked the code tab, replaced the old code with the new one and clicked deploy. Supabase says deploy was successful but I see how the new code disappears and the old code is back. I've tried multiple times, same happens. The function is 656 lines of code. But it is not the length, since i can't even create a new file with 1 line of code under the function, when I click on deploy, it just gets wiped out (even though the successful deployment alert appears). I tried logging out and back in to supabase dashboard to check if it was an expired token issue, didn't work either. I'm not technical, I'd like to be able to do this via the dashboard, not locally. I'd appreciate help. Thank you
4 Replies
ibrahim
ibrahim4d ago
is this the same function that you originally tried to deploy that doesn't accept 1 line because supabase as a maximum function size as seen here https://supabase.com/docs/guides/functions/limits which is 20mb. This could be the cause of your error but i want to check can you create any edge function at all from the dashboard, for example
Limits | Supabase Docs
Limits applied Edge Functions in Supabase's hosted platform.
ibrahim
ibrahim4d ago
// Setup type definitions for built-in Supabase Runtime APIs
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
interface reqPayload {
name: string;
}

console.info('server started');

Deno.serve(async (req: Request) => {
const { name }: reqPayload = await req.json();
const data = {
message: `Hello ${name}!`,
};

return new Response(
JSON.stringify(data),
{ headers: { 'Content-Type': 'application/json', 'Connection': 'keep-alive' }}
);
});
// Setup type definitions for built-in Supabase Runtime APIs
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
interface reqPayload {
name: string;
}

console.info('server started');

Deno.serve(async (req: Request) => {
const { name }: reqPayload = await req.json();
const data = {
message: `Hello ${name}!`,
};

return new Response(
JSON.stringify(data),
{ headers: { 'Content-Type': 'application/json', 'Connection': 'keep-alive' }}
);
});
franknoro
franknoroOP3d ago
Thanks for the info. After retrying many times tweaking the code it worked. Maybe it was that, Supabase should return the appropriate error message instead of saying it deployed successfully though
ibrahim
ibrahim3d ago
perhaps it might be worth leaving an issue on https://github.com/supabase/supabase/issues
GitHub
supabase/supabase
The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. - supabase/supabase

Did you find this page helpful?