T
TanStack•3mo ago
rival-black

Deploy cloudlfare worker error

I'm trying to deploy my tanstack start app to cloudflare workers. When I deploy with wrangler CLI it works fine, but when I connect my github so that it triggers deploy when I push some code the deploy fails. Here are logs from cloudflare:
21:27:36.092 Using redirected Wrangler configuration.
21:27:36.092 - Configuration being used: ".output/server/wrangler.json"
21:27:36.092 - Original user's configuration: "wrangler.toml"
21:27:36.092 - Deploy configuration file: ".wrangler/deploy/config.json"
21:27:36.097
21:27:36.148 ✘ [ERROR] Processing .output/server/wrangler.json configuration:
21:27:36.148
21:27:36.148 - Redirected configurations cannot include environments but the following have been found:
21:27:36.149 - develop
21:27:36.149 - production
21:27:36.149
21:27:36.149
21:27:36.149 Such configurations are generated by tools, meaning that one of the tools
21:27:36.149 your application is using is generating the incorrect configuration.
21:27:36.149 Report this issue to the tool's author so that this can be fixed there.
21:27:36.149
21:27:36.149
21:27:36.160
21:27:36.160 Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
21:27:36.092 Using redirected Wrangler configuration.
21:27:36.092 - Configuration being used: ".output/server/wrangler.json"
21:27:36.092 - Original user's configuration: "wrangler.toml"
21:27:36.092 - Deploy configuration file: ".wrangler/deploy/config.json"
21:27:36.097
21:27:36.148 ✘ [ERROR] Processing .output/server/wrangler.json configuration:
21:27:36.148
21:27:36.148 - Redirected configurations cannot include environments but the following have been found:
21:27:36.149 - develop
21:27:36.149 - production
21:27:36.149
21:27:36.149
21:27:36.149 Such configurations are generated by tools, meaning that one of the tools
21:27:36.149 your application is using is generating the incorrect configuration.
21:27:36.149 Report this issue to the tool's author so that this can be fixed there.
21:27:36.149
21:27:36.149
21:27:36.160
21:27:36.160 Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
as you can see I have two environments in my wrangler.toml: 1. develop 2. production any idea how to fix it? šŸ™
5 Replies
rival-black
rival-blackOP•3mo ago
it suggest that vite build should generate wrangler.json in .output/server/wrangler.json but I cannot see anything like this okay, I've added --env develop to my deploy script: wrangler deploy --env develop and now getting such error:
22:07:07.955
22:07:08.042 ✘ [ERROR] Processing .output/server/wrangler.json configuration:
22:07:08.042
22:07:08.042 - Redirected configurations cannot include environments but the following have been found:
22:07:08.043 - develop
22:07:08.043 - production
22:07:08.043
22:07:08.043
22:07:08.043 Such configurations are generated by tools, meaning that one of the tools
22:07:08.043 your application is using is generating the incorrect configuration.
22:07:08.043 Report this issue to the tool's author so that this can be fixed there.
22:07:08.043 - You have specified the environment "develop", but are using a redirected configuration, produced by a build tool such as Vite.
22:07:08.044 You need to set the environment in your build tool, rather than via Wrangler.
22:07:08.044 For example, if you are using Vite, refer to these docs: https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/
22:07:07.955
22:07:08.042 ✘ [ERROR] Processing .output/server/wrangler.json configuration:
22:07:08.042
22:07:08.042 - Redirected configurations cannot include environments but the following have been found:
22:07:08.043 - develop
22:07:08.043 - production
22:07:08.043
22:07:08.043
22:07:08.043 Such configurations are generated by tools, meaning that one of the tools
22:07:08.043 your application is using is generating the incorrect configuration.
22:07:08.043 Report this issue to the tool's author so that this can be fixed there.
22:07:08.043 - You have specified the environment "develop", but are using a redirected configuration, produced by a build tool such as Vite.
22:07:08.044 You need to set the environment in your build tool, rather than via Wrangler.
22:07:08.044 For example, if you are using Vite, refer to these docs: https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/
and adding CLOUDFLARE_ENV=production doesn't help neither
flat-fuchsia
flat-fuchsia•3mo ago
I’m having the same issue
harsh-harlequin
harsh-harlequin•3mo ago
Did you find any solution for this @radek1313 ?
rival-black
rival-blackOP•3mo ago
Unfortunately no, @Manuel Schiller is there some way to handle this?
quickest-silver
quickest-silver•3mo ago
we'll soon fully support the vite cloudflare plugin

Did you find this page helpful?