Workers-specific command in a Pages project

No matter how I try and deploy my project I keep getting stopped at the last step. I am using the GitHub integration and have set my CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN under Variables and Secrets in the Settings tab of my worker. I've also tried to check and it appears I am in a workers project NOT a pages one. But every time I build it goes through everything and then fails right at the end with a message that says something to the effect of 23:39:50.481 ✘ [ERROR] It looks like you've run a Workers-specific command in a Pages project. 23:39:50.482
23:39:50.482 For Pages, please run wrangler pages deploy instead. and if I try and follow the instructions and do wranglers pages deploy I get the following: 23:22:22.997 Success: Build command completed 23:22:22.999 Executing user deploy command: npx wrangler pages deploy .vercel/output/static --project-name index 23:22:24.127
23:22:24.179 ✘ [ERROR] Running configuration file validation for Pages: 23:22:24.179
23:22:24.180 - Configuration file for Pages projects does not support "account_id" I don't have any "account_id" in my wrangler.toml file, and I have tried setting both wrangler deploy for pages and workers, and I keep just getting the same thing.
I see that there is a bug request here: https://github.com/cloudflare/workers-sdk/issues/6466 but I don't see a work around or a clear explanation of what causes this. I am at a complete loss in what to do.
GitHub
🐛 BUG: Build Requests account_id in Wrangler.toml but fails wi...
Which Cloudflare product(s) does this pertain to? Workers Runtime What version(s) of the tool(s) are you using? 3.70.0 [wrangler] What version of Node are you using? No response What operating syst...
8 Replies
Chaika
Chaika3d ago
So you're using Workers and Workers CI, right? It sounds like you just have pages_build_output_dir set in your toml. If you want static assets with Workers, should be the assets binding like https://developers.cloudflare.com/workers/static-assets/ and then using wrangler deploy
directnirvana
directnirvanaOP3d ago
I absolutely do have that, but I would think that either: 1. Using workers it would kick the directory if not using it 2. Using pages it would work and deploy
Chaika
Chaika3d ago
What do you mean "kick the directory if not using it"?
directnirvana
directnirvanaOP3d ago
I would think it would just ignore it
Chaika
Chaika3d ago
Having it set is signaling to Wrangler you're trying to do a Pages project and thus should use Pages commands and such it perhaps should be more explicit in its warning though, I believe it was added before workers static assets became a thing anyway you just have to go one way or another: Use the newer workers static assets and workers Ci/cd, config is above, remove pages references in your toml Or go the way of Pages, setup a pages project to your github repo, etc
directnirvana
directnirvanaOP3d ago
I tried commenting it out in the .toml file I'm going to see if that moves me along, its building now. But what you're saying defintely makes sense ✨ Success! Build completed. You're a hero! Better than 3 hours of Google searches and 2 different AI's, thanks so much
Chaika
Chaika3d ago
Sure, worth noting without having static assets setup it just won't be having any static assets/all requests will hit your worker, if you get confused by that
directnirvana
directnirvanaOP3d ago
I'll keep that in mind while I try and continue on with this project tomorrow, thanks for the help and the details on static assets

Did you find this page helpful?