You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running commands such as wrangler secrets list or wrangler 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:
$ npx wrangler@latest secret list
✘ [ERROR] A request to the Cloudflare API (/accounts/4e599df4216133509abaac54b109a647/workers/scripts/pages-example/secrets) failed.
This Worker does not exist on your account. [code: 10007]
If you think this is a bug, please open an issue at:
https://github.com/cloudflare/workers-sdk/issues/new/choose
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:
$ npx wrangler@latest secret list
✘ [ERROR] This command is for Workers, for Pages please run `wrangler pages secret list`
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 to wrangler 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.
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: