i get an "EACCES: permission denied, scandir '/lost+found'" error when trying to build

hello! this is my first time trying to have my own website, so please bear with me if i don't know/understand anything obvious (or if this is in the wrong channel) :) i'm trying to build a simple website using html, css and js. i have a .xyz domain that i connected to a free cloudflare plan, but after i added my github repo to a cloudflare worker and tried building, i get the EACCES: permission denied, scandir '/lost+found' error. i searched for a solution but couldn't find anything so i'm hoping that i can get some help here :D i'm not sure if i need to attach any code, so if it's needed just ask :)
4 Replies
Smasher1
Smasher1OP3mo ago
unsure if these are needed but posting them anyway, these are the contents of index.js and wrangler.jsonc (in order)
// index.js

export default {
async fetch(request, env) {
const url = new URL(request.url);

if (url.pathname.startsWith("/api/")) {
return new Response(JSON.stringify({ name: "Cloudflare" }), {
headers: { "Content-Type": "application/json" },
});
}

return env.ASSETS.fetch(request);
},
};
// index.js

export default {
async fetch(request, env) {
const url = new URL(request.url);

if (url.pathname.startsWith("/api/")) {
return new Response(JSON.stringify({ name: "Cloudflare" }), {
headers: { "Content-Type": "application/json" },
});
}

return env.ASSETS.fetch(request);
},
};
{
"name": "smasher1-website",
"main": "index.js",
"compatibility_date": "2025-09-16",
"assets": {
"directory": "/",
"binding": "ASSETS"
}
}
{
"name": "smasher1-website",
"main": "index.js",
"compatibility_date": "2025-09-16",
"assets": {
"directory": "/",
"binding": "ASSETS"
}
}
texan
texan3mo ago
Hey @Smasher1 , did you actually mean to specify your directory as “./“? you have it as / which will be root
Smasher1
Smasher1OP3mo ago
I don't know, it used to say The entry-point file at "src/index.js" was not found. until i set the path to /. the files are just stored in what i'm guessing the root directory is, not in any special folders like /cloudflare/ wrangler/
No description
Smasher1
Smasher1OP3mo ago
i changed the root directory in wrangler.jsonc from / to ./ and it worked! thanks! :D

Did you find this page helpful?