Skip to content

Conversation

@admah
Copy link
Contributor

@admah admah commented Jan 29, 2024

Updated local bindings sections for: kv, r2, d1, and service bindings since those are currently supported.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: beb2b42
Status:🚫  Build failed.

View logs

@github-actions
Copy link
Contributor

@Cherry
Copy link
Contributor

Cherry commented Jan 29, 2024

Pages using wrangler.toml locally but not when you publish really confuses people. We see it every single week in the Discord.

cloudflare/workers-sdk#3757

It seems a little strange to me to encourage this behaviour until Pages actually has full support for configuration in some capacity.

@admah
Copy link
Contributor Author

admah commented Jan 30, 2024

@Cherry the goal of adding this would be to clear up that confusion for users by stating explicitly what is supported now. We are working towards support for Pages file-based configuration so we're not going to remove what is currently exposed. As we work towards that, we are also using this functionality to support better framework development like in next-on-pages and via the getBindingsProxy API.

@Cherry
Copy link
Contributor

Cherry commented Jan 30, 2024

I left a comment on the workers-sdk PR, but I'm personally not sure this reduces confusion. 🤷‍♀️ Leaning into what has been considered a bug for years, with everyone being told that Pages does not support wrangler.toml, seems odd to me.

Especially if folks are going to have to update their configs again when Pages does support configuration.


{{<Aside type="note">}}

`wrangler.toml` is currently **only** used for local development. Bindings specified in it are not available remotely.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These callouts are very helpful

@jkonowitch
Copy link

We are working towards support for Pages file-based configuration

Just to make sure I understand, is the plan to support wrangler.toml configuration for deploys on-par with how Workers work?

@Cherry
Copy link
Contributor

Cherry commented Feb 14, 2024

I think it would be extremely beneficial to hold this PR until it's made very clear in wrangler pages deploy commands and Pages CI that publishing a project with bindings in your wrangler.toml won't actually make them available in production. This is a serious confusion and pain point people hit constantly with Pages commands, with the wrangler.toml local functionality being described as a bug for years.

This is made especially and even more confusing when these new docs talk about Pages, link to wrangler configuration docs that detail how this does work when deploying (the linked docs pages are tailored for Workers), but then doesn't and no warnings are presented to the user. Most users struggle to understand the nuances between Workers and Pages right now, and I personally think this only adds to the confusion.

@admah admah merged commit 0d7e980 into production Feb 27, 2024
@admah admah deleted the update-pages-local-bindings branch February 27, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants