#Deploy cloudlfare worker error

7 messages · Page 1 of 1 (latest)

fiery lava
#

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

as you can see I have two environments in my wrangler.toml:

  1. develop
  2. production

any idea how to fix it? 🙏

#

it suggest that vite build should generate wrangler.json in .output/server/wrangler.json but I cannot see anything like this

fiery lava
#

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/
#

and adding CLOUDFLARE_ENV=production doesn't help neither

vague coral
#

I’m having the same issue

lavish dagger
#

Did you find any solution for this @fiery lava ?

fiery lava