No Pages config file found - can we use a config for Pages?

Hello, Just started to use pages and during some first builds get the error about No Pages config file found. Similar questions in Discord - https://discord.com/channels/595317990191398933/1229151082576613528/1229151082576613528 - https://discord.com/channels/595317990191398933/1227717205618196563/1227717205618196563 - https://discord.com/channels/595317990191398933/789155108529111069/1227713222744735857 - https://discord.com/channels/595317990191398933/1227677318399393944/1227677318399393944 And now see Checking for configuration in a wrangler.toml configuration file (BETA). And would like to ask if we can configure Pages via config file, like GitHub Actions workflow or something similar? In that way we can have all configuration in Git repository and adjust settings without access to the Dashboard.
9 Replies
Chaika
Chaika8mo ago
You can yea: https://developers.cloudflare.com/pages/functions/wrangler-configuration/ part of https://blog.cloudflare.com/pages-workers-integrations-monorepos-nextjs-wrangler dev week announcement. Just be careful if you're migrating that you get all your environment variables/binding/etc into the toml, the toml is your source of truth if you start using it, any bindings not in it would get removed
Cloudflare Docs
Configuration · Cloudflare Pages docs
Pages Functions can be configured two ways, either via the Cloudflare dashboard or wrangler.toml, a configuration file used to customize the …
Air
AirOP8mo ago
Thanks, that look like what I'm looking for. Is that missing from Pages documentation for now?
No description
Chaika
Chaika8mo ago
no I linked it above the blog post link
Chaika
Chaika8mo ago
Cloudflare Docs
Configuration · Cloudflare Pages docs
Pages Functions can be configured two ways, either via the Cloudflare dashboard or wrangler.toml, a configuration file used to customize the …
Air
AirOP8mo ago
@Chaika, can't you please point to the documentation with Pages related configuration options? I've tried to download existing config
npx wrangler@latest pages download config cloudflare-pages
npx wrangler@latest pages download config cloudflare-pages
but got a very basic one
# Generated by Wrangler on Wed Apr 17 2024 18:33:28 GMT+0000 (Coordinated Universal Time)
name = "cloudflare-pages"
pages_build_output_dir = "_site"
compatibility_date = "2024-04-15"

[vars]
CF_PAGES_URL = "CF_PAGES_URL"

[env.production]
compatibility_date = "2024-04-15"
# Generated by Wrangler on Wed Apr 17 2024 18:33:28 GMT+0000 (Coordinated Universal Time)
name = "cloudflare-pages"
pages_build_output_dir = "_site"
compatibility_date = "2024-04-15"

[vars]
CF_PAGES_URL = "CF_PAGES_URL"

[env.production]
compatibility_date = "2024-04-15"
I'm looking into the Configure wrangler.toml, but can't find other settings I can see in the UI
No description
Chaika
Chaika8mo ago
The docs you linked are for Workers. The one I linked above is specifically about the Pages one: https://developers.cloudflare.com/pages/functions/wrangler-configuration/ but as far as I know pages_build_output_dir is the only special Pages one. The toml is just for your Pages Functions, not the entire project
Air
AirOP8mo ago
so, at the moment we can't fully control static site deployment via config file?
Chaika
Chaika8mo ago
It's more for Pages Functions and all the Functions stuff I'm not sure if they plan on moving it to build settings and such, I skimmed the blog post and the docs and can't find any reference to that
Air
AirOP8mo ago
good, thanks - will follow future updates, now UI is a single option one more confirmation, that there is no feature parity at the moment for Config/UI - https://discord.com/channels/595317990191398933/920749372256419930/1226764270231097499
Want results from more Discord servers?
Add your server