Fix wrangler deploy failing for new workers containing environment variables or bindings#11504
Conversation
…variables or bindings
🦋 Changeset detectedLatest commit: 87bb3d0 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| url | ||
| ); | ||
| ).catch((e) => { | ||
| if (e instanceof APIError && e.code === 10007) { |
There was a problem hiding this comment.
This seems sensible to me, but I am happy to broaden this that's preferred 🙂
There was a problem hiding this comment.
Are we confident the error code will always be 10007 for this scenario?
There was a problem hiding this comment.
Happy with this from the backend side of house 👍
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
PS: I can see a few places where we check for code 10007 errors, I will open a followup PR to consolidate those, but for this PR, in order to safely fix the latest release, I'd avoid the extra unnecessary risk and just proceed with this the bugfix |
Agree it's not for this PR but we should really get rid of all these magic numbers and have an object with the error codes that we can import from. |
Fixes the regression introduced in #11389 present in the latest version of wrangler that causes
wrangler deployrun on never deployed worker failing if they have any environment variables or bindings in their configuration.