A couple of bugs I faced today (`dev`, `publish`)
See original GitHub issueToday on my personal laptop, I used wrangler and faced some issues. If necessary I’ll file separate issues for each of these problems, but just filing these right now while the details are still fresh -
- I made a file
index.ts
with contents
and ranexport default { fetch() { return new Response("hello world"); }, };
npx wrangler@beta dev index.ts
on it. It returned -
I think this means that both theNo account id found, quitting...
oauth_code
andrefresh_code
were invalid. In such a scenario, we should popup the login flow again. I manually rannpx wrangler@beta login
and ‘fixed’ this issue. - I then tried to publish it with
npx wrangler publish index.js --name devto --latest
(and I didn’t have a script nameddevto
already published). It did nothing for a long time (say, 20 seconds), and then this error got logged
I think this is pointing to this line of code https://github.com/cloudflare/wrangler2/blob/b63efe60646c8c955f4df4f2ce1d87ce9cc84ba3/packages/wrangler/src/cfetch/index.ts#L93Cannot read properties of undefined (reading 'forEach')
- We should include stacks in our errors here https://github.com/cloudflare/wrangler2/blob/a5537f147e61b046e141e06d1864ffa62e1f2673/packages/wrangler/src/index.tsx#L2034-L2045 (logging
e.stack
instead ofe.message
). If we think these are noisy, then we should handle expected errors properly, and exit withprocess.exit(1)
instead of throwing. - It looks like there are failure modes for api calls we haven’t considered. Specifically, it’s possible for the api to not follow the api schema (which, makes sense, networks suck). We should be more defensive in how we handle data structures off the network (In this case, testing whether
messages
exists on the response) - running the command again published the worker successfully.
- We should include stacks in our errors here https://github.com/cloudflare/wrangler2/blob/a5537f147e61b046e141e06d1864ffa62e1f2673/packages/wrangler/src/index.tsx#L2034-L2045 (logging
- When running
dev
, using the hotkeyl
to toggle between edge - local - edge logged this error
This means that we’re not shutting down the miniflare server cleanly, or maybe we’re trying to startup the remote proxy too soon after switching (before the miniflare server has closed).17:48:12 Error: listen EADDRINUSE: address already in use :::8787 at Server.setupListenHandle [as _listen2] (node:net:1334:16) at listenInCluster (node:net:1382:12) at Server.listen (node:net:1469:7) ...
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Developers — Take Bug Reports As Opportunities, Not ...
I recently released a major update to a web application I work on. The update included numerous new features as well as upgrades...
Read more >What should be done after a bug is found (Bug Defect ...
Reporting bug immediately will help to write a good bug report, which help developer to get an exact idea of the problem faced...
Read more >5 Common Bugs Faced in UI Testing - BrowserStack
Read this article by BrowserStack to understand the most commonly encountered UI bugs by the QAs while performing tests for UI and UX....
Read more >How to answer interview question “You find a major bug, but ...
You find a major bug, but no developers are present. The release deadline is today. What do you do? It's not a difficult...
Read more >A day in the life: how a frontend developer solves a "simple" bug
The Bug. I had implemented a new report page for one of our applications, where the user can create a spreadsheet like report...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be in a better place now. We still need to handle error messages better and present them in a better manner, tracking that in https://github.com/cloudflare/wrangler2/issues/377. Closing this issue. @tanguyantoine let us know if you face the issue again, thank you!
Sorry I switched back on something else, I might give it another shot later