workers-sdk
workers-sdk copied to clipboard
🐛 BUG: publish fails when attempting to publish a Worker to routes that already exist
What version of Wrangler are you using?
2.1.3
What operating system are you using?
Mac
Describe the Bug
When attempting to publish a Worker to a custom domain on routes that already exist on a different worker on the same domain the publish fails with:
✘ [ERROR] A request to the Cloudflare API (/accounts/
workers.api.error.unknown [code: 10013]
I can understand that there may be no one right answer to resolve this issue, but the error message could be improved and could include steps for resolution of common scenarios, e.g: manually remove the routes in the dashboard (or via API I suppose) that are needed for the publish to succeed.
Hey @jsvsco - any chance you could send over a minimal reproduction of this?
- Create a new worker in the Cloudflare Workers dashboard.
- Assign it a route on a custom domain.
- Initialize a new worker locally in Wrangler with a different name from the worker in (1).
- Add the same route as (2) to its wrangler.toml.
- Attempt to publish the worker with Wrangler and you should receive the error above.
Ah custom domains get dealt with separately than other routes. So perhaps we need to implement something similar to https://github.com/cloudflare/wrangler2/commit/b44cc26546e4b625870ba88b292da548b6a340c0#diff-d79823fe1e90cdc27158bbeaab5f58954e81375f84f4403ca124318c7bccd54fR673-R686 for custom domains.
I didn't think about it, but it makes sense that custom domain is important. I updated the original report.