S
Supabase•3w ago
Juan

Error Edge Functoins

I get the following error: Entrypoint path does not exist - /tmp/user_fn_ofmmnwuobekwneblkcdv_76afd757-9a1a-4964-a0cc-f5163c726acc_1/source/index.ts It happens when I try to deploy my edge function, do you know what the reason would be? code:
const zipCheck = new AdmZip(ZIP_PATH);
console.log(ZIP_PATH, 'creado correctamente');
console.log('📦 Contenido del ZIP:', zipCheck.getEntries().map(e => e.entryName));

// Metadata
const METADATA = {
name: FUNCTION_NAME,
entrypoint_path: 'index.ts', // <- probar así primero
verify_jwt: false,
import_map_path: 'deno.json',
static_patterns: [],
};

// Enviar a Supabase
const form = new FormData();
form.append('metadata', JSON.stringify(METADATA), { contentType: 'application/json' });
form.append('file', fs.createReadStream(ZIP_PATH), {
filename: 'function.zip',
contentType: 'application/zip',
});

const response = await axios.post(
`https://api.supabase.com/v1/projects/${PROJECT_REF}/functions/deploy`,
form,
{
headers: {
...form.getHeaders(),
Authorization: `Bearer ${ACCESS_TOKEN}`,
Accept: 'application/json',
},
}
);
const zipCheck = new AdmZip(ZIP_PATH);
console.log(ZIP_PATH, 'creado correctamente');
console.log('📦 Contenido del ZIP:', zipCheck.getEntries().map(e => e.entryName));

// Metadata
const METADATA = {
name: FUNCTION_NAME,
entrypoint_path: 'index.ts', // <- probar así primero
verify_jwt: false,
import_map_path: 'deno.json',
static_patterns: [],
};

// Enviar a Supabase
const form = new FormData();
form.append('metadata', JSON.stringify(METADATA), { contentType: 'application/json' });
form.append('file', fs.createReadStream(ZIP_PATH), {
filename: 'function.zip',
contentType: 'application/zip',
});

const response = await axios.post(
`https://api.supabase.com/v1/projects/${PROJECT_REF}/functions/deploy`,
form,
{
headers: {
...form.getHeaders(),
Authorization: `Bearer ${ACCESS_TOKEN}`,
Accept: 'application/json',
},
}
);
5 Replies
OakRatos
OakRatos•3w ago
@Juan it seems the ZIP doesn’t include source/index.ts, which is required as the entrypoint. Please make sure your ZIP has a source folder containing index.ts exactly at that path. You can confirm using zipCheck.getEntries() output.
Juan
JuanOP•3w ago
This is the structure of the zip that is created, the index.ts is already inside the source. from function is the unzipped zip
No description
OakRatos
OakRatos•3w ago
@Juan it looks like index.ts is inside the source folder, so you should update entrypoint path to 'source/index.ts' in the metadata. That should resolve the deployment error.
Juan
JuanOP•3w ago
@OakRatos new Metadata with "source/index.ts"
const METADATA = {
name: FUNCTION_NAME,
entrypoint_path: 'source/index.ts',
verify_jwt: false,
static_patterns: [],
};
const METADATA = {
name: FUNCTION_NAME,
entrypoint_path: 'source/index.ts',
verify_jwt: false,
static_patterns: [],
};
the same error but source is duplicate: message: 'Entrypoint path does not exist - /tmp/user_fn_ofmmnwuobekwneblkcdv_615d1233-b638-40cf-803a-393f4c6b693a_1/source/source/index.ts' Do I need to do any extra configuration manually on the dashboard?
OakRatos
OakRatos•3w ago
@Juan set entrypoint_path to 'index.ts' , ZIP already includes the source folder.

Did you find this page helpful?