Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't log an error when wrangler dev is cancelled early #823

Merged
merged 1 commit into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/nice-dingos-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"wrangler": patch
---

fix: don't log an error when `wrangler dev` is cancelled early

We currently log an `AbortError` with a stack if we exit `wrangler dev`'s startup process before it's done. This fix skips logging that error (since it's not an exception).

Test plan:

```
cd packages/wrangler
npm run build
cd ../../examples/workers-chat-demo
npx wrangler dev
# hit [x] as soon as the hotkey shortcut bar shows
```
4 changes: 3 additions & 1 deletion packages/wrangler/src/dev/remote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ export function useWorker(props: {
start().catch((err) => {
// we want to log the error, but not end the process
// since it could recover after the developer fixes whatever's wrong
console.error("remote worker:", err);
if ((err as { code: string }).code !== "ABORT_ERR") {
console.error("remote worker:", err);
}
});

return () => {
Expand Down