🐛 BUG: Cloudflare pages not deploying functions
See original GitHub issueWhat version of Wrangler
are you using?
2
What operating system are you using?
Cloudflare Pages
Describe the Bug
Wrangler is not detecting functions routes, when deploying with Cloudflare Pgaes from github repo.
output below, when ‘/functions/api/contact.ts’ function file exists.
11:19:55.381 | 🚧 ‘wrangler pages <command>’ is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose |
---|---|
11:19:55.389 | |
11:19:55.490 | [31m✘ [41;31m[[41;97mERROR[41;31m][0m [1mNo routes found when building Functions directory: /opt/buildhome/repo/functions[0m |
11:19:55.491 | |
11:19:55.491 | |
11:19:55.491 | [32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose[0m |
11:19:55.502 | Warning: Wrangler did not find routes when building functions. Skipping. |
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:16 (2 by maintainers)
Top Results From Across the Web
Known issues · Cloudflare Pages docs
Here are some known bugs and issues with Cloudflare Pages: ... Functions (beta) does not currently support adding/removing polyfills, ...
Read more >Pages deployment failed if functions are includes
I use Cloudflare pages for deploying a static nuxt 3 app and want to have one worker/functions endpoint for a contact form.
Read more >functions dir is ignored in deploy - Cloudflare Pages
Hi there, I am deploying a simple reference website for an open source project. The reference website is automatically generated by TypeDoc ...
Read more >Issues deploying page website - Cloudflare Community
Hey, I have an issue deploying my website on Cloudflare page. The website can be built, but it seems to have an issue...
Read more >Debugging Pages - Cloudflare Docs
If you are not using Functions or have reviewed that your Functions configuration does not contain any errors, review the Cloudflare Status site ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally, Nitro seems to detect the deployment environment (see Zero-Config Providers doc), and select the right preset (in this case
cloudflare_pages
I presume). In the Nitro clouldflare.ts, we can see :The server directory
/functions
folder is emptied before each Nitro prerender. I suppose that Nuxt 3/server
folder should be used as source of functions folder but there’s some issues.I fixed the problem by setting the environment variable
NITRO_PRESET=node-server
in CF settings.@luc122c
Unfortunately that does not help those of us that that DO NOT want SSR, but still want the Cloudflare functions. With is preset you should be able to do either a SPA or SSR.
nuxt build
is for SSR andnuxt generate
is for static/SPA. Currently it will not create the Cloudflare functions if you usenuxt generate