Worker publish failing with 10019 error

We are trying to deploy a Cloudflare worker using wrangler. While trying to publish this to a new zone, we are getting below error

2022-09-16 05:24:16.850   ⠤ Configuring routes...
2022-09-16 05:24:16.853    Successfully published your script to
2022-09-16 05:24:16.855  https://*/cfw/admin-api/* => creation failed: Code 10019: workers.api.error.invalid_route_script_missing

Here is the wrangler-template.toml

name = "cf_worker_api_interceptor"
type = "javascript"
routes = [ "https://*/cfw/admin-api/*" ]
account_id ="${CLOUDFLARE_ACCOUNT_ID}"
zone_id="${CLOUDFLARE_ZONE_ID}"
workers_dev = false

compatibility_date = "2021-11-15"
compatibility_flags = []


[build]
command = "npm run build"

[build.upload]
format = "modules"
dir = "dist"
main = "./index.mjs"


[vars]
PROXY_URL ="prod-domain.com/"

[env.production]
vars = { PROXY_URL ="prod-domain.com/" }
routes = [ "https://*/cfw/admin-api/*" ]

[env.development]
vars = { PROXY_URL ="dev-domain.com/" }
routes = [ "https://*/cfw/admin-api/*" ]

[env.qa]
vars = { PROXY_URL ="dev-domain.com/" } //Sample value
routes = [ "https://*/cfw/admin-api/*" ]

We are using wrangler publish --env development for publishing the worker.

What could be going wrong here?

My guess it is because your routes aren’t a valid URL.