Pages, Functions, 404s

Hi, I am having a lot of trouble getting my site live. I have already tried using chat gpt to trouble shoot everything but i still get 404 errors. It seems like theres an issue with Functions working on the page, but I cannot figure out how to fix it. These are the instructions chat gpt gives me, but I do not see an "Enable Functions" button... In Cloudflare Dashboard → Pages → Your Project → Settings → Functions, ensure Functions are enabled. You don’t need to add /functions/helloworld.js — your _worker.js already exists. Pages should automatically detect _worker.js once Functions are on. Redeploy (via Git push). Check the Functions tab in the dashboard — you should see /[slug] listed. Visit /test123 → it should now hit your Supabase redirect logic. Any advice? (URL Is sitesplit.app / https://28bb5077.sitesplit.pages.dev/test123)
No description
2 Replies
scalewithsteven
scalewithstevenOP3mo ago
From chat gpt: That means Pages is still locked into “file-based mode” instead of looking for _worker.js (advanced mode). Your copy command didn’t change anything because Pages never checks inside /static/_worker.js in the first place — it only looks for /functions or a _worker.js at the root of the output directory. >> How do i change this?
VCent
VCent3mo ago
Are you using workers or pages? Are you serving the correct folder (the one with your static assets, not the functions folder)? It's hard to parse stuff from chatgpt responses but I guess you want to use advanced mode? If so check: https://developers.cloudflare.com/pages/functions/advanced-mode/
Cloudflare Docs
Advanced mode
Advanced mode allows you to develop your Pages Functions with a _worker.js file rather than the /functions directory.

Did you find this page helpful?