🐛 BUG: Throw an actionable error if we detect a Pages project using Workers commands #6793
Labels
bug
Something that isn't working
error-messaging
Improving user facing error messages
pages
Relating to Pages
quick win
Potentially easy/straightforward issue to tackle
wrangler
Relating to the Wrangler CLI tool
Which Cloudflare product(s) does this pertain to?
Wrangler
What version(s) of the tool(s) are you using?
v3.78.7
What version of Node are you using?
No response
What operating system and version are you using?
Macos 14.6.1 (23G93)
Describe the Bug
Observed behavior
When running commands such as
wrangler secrets list
orwrangler deploy
we should be detecting if the project a user is in is a Pages project (has pages output dir in wrangler.toml) and throw an actionable error for the user pointing them to the command needed for Pages.Currently, running these commands will do Worker actions and cause confusion for users.
For example, running
wrangler secrets list
currently outputs:which is very confusing for a user - they know the Pages Worker exists but it says it doesn't.
Instead, we should do an output like:
Another example is deploy where it'll error about
main
not being set - if a user sets that, they're now gonna deploy a Worker which will not be what they want and will not work like they expect. This should also link towrangler pages deploy
.I think for non-wrangler.toml projects, we cannot nicely handle this today but we can at least improve it for those with the toml file.
Steps to reproduce
wrangler secret list
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
cc: @IgorMinar
The text was updated successfully, but these errors were encountered: