question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛 BUG: Routes do not work with `--env`

See original GitHub issue

What version of Wrangler are you using?

0.0.0-21ee93e

What operating system are you using?

Linux

Describe the Bug

In https://github.com/cloudflare/wrangler2/blob/c75cfb83df4c98d6f678535439483948ce9fff5b/packages/wrangler/src/publish.ts#L208-L212

when notProd is true and routes are specified, the request to

PUT /accounts/${accountId}/workers/services/${scriptName}/environments/${envName}/routes

https://github.com/cloudflare/wrangler2/blob/c75cfb83df4c98d6f678535439483948ce9fff5b/packages/wrangler/src/publish.ts#L273

fails with

✘ [ERROR] Received a bad response from the API

  workers.api.error.internal_server [code: 10002]

I could not find any api documentation for the “environment / env routes” to check if its a issue with the payload.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
skirstencommented, May 31, 2022

Hi, I just checked this again and I also cannot reproduce it anymore. It seems to be fixed now. Thanks 😃

0reactions
caasscommented, May 31, 2022

Hey, I’m looking into this and having trouble reproducing the issue. Can you provide the steps you took when you encountered this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

🐛 BUG: Routes do not work if api token is restricted to zone ...
In Wrangler 1, you had to specify the zone_id and so it was able to hit a zone specific REST endpoint that only...
Read more >
Environment variables not working (Next.JS 9.4.4)
Any help would be much appreciated! EDIT : So i've fixed this by adding my env variables to my next.config.js like so :...
Read more >
.env Not Reading Variables Sometimes - Laracasts
In my case its not reading any variables. I am trying to print the variable but they are all empty. Its working on...
Read more >
React Router DOM: How to handle routing in web apps
React Router DOM contains the DOM bindings for React Router. Learn about its essential components and how to build routes with parameters.
Read more >
Routes · Cloudflare Workers docs
Routes allow users to map a URL pattern to a Worker script to enable Workers to run in front of Custom Domains or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found