Where are functions located?
# workers-help
e
Feels a bit silly asking this but I keep calling or visiting my function url on my deployed site (like example.com/functions/my-function), but I get a 404 response from my frontend application. What is the correct path for functions once the site has been deployed? Could anything else be happening here?
Locally with Wrangler it works fine on the local URL (localhost:3000/functions/my-function)
c
it wouldn't be under /functions/ unless you had /functions/functions. Docs here: https://developers.cloudflare.com/pages/functions/routing/ I'd also make sure Pages is picking it up, the functions folder needs to be in your root folder, not build output. You can check under the Functions tab of your deployment
e
Ah great thanks
c
Your build log will say either > Note: No functions dir at /functions found. Skipping. or > 13:12:57.991 Found Functions directory at /functions. Uploading. > 13:12:59.384 ✨ Compiled Worker successfully another thing to check
e
Aha the problem was I had used
export default
which worked in Wrangler but seems to trigger the error when it's deployed.