Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[dev] pass --inspect flag to get websocket endpoint for chrome://inspect #946

Closed
EverlastingBugstopper opened this issue Dec 11, 2019 · 6 comments · Fixed by #2016
Closed
Labels
dev `wrangler dev` feature Feature requests and suggestions never stale

Comments

@EverlastingBugstopper
Copy link
Contributor

EverlastingBugstopper commented Dec 11, 2019

node provides an interesting way to attach a debugger to its REPL

$ node --inspect
Debugger listening on ws://127.0.0.1:9229/long-hash-hash-hash-hash
For help, see: https://nodejs.org/en/docs/inspector

You can then navigate to chrome://inspect and it will show a node instance. If you run console.log in the node process, it will show up in the console on the browser.

I think it would be a good idea to add --inspect to wrangler dev. This would mean that when your dev server starts up, it acts the same way in the terminal, except it also takes all websocket messages it receives and passes it to a local websocket listening on your machine. This would work the same way that the node inspector does, and you'd be able to navigate to chrome://inspect and see wrangler dev there instead of node.

A pitfall with this is that the runtime's implementation of the devtools protocol is incomplete (you can't set breakpoints). But I still think it's worth having - especially for interacting with large nested objects and viewing network requests.

@PierBover
Copy link

@EverlastingBugstopper when dev crashes we'd need to manually reopen chrome://inspect right?

Since I imagine the node process would be killed.

@EverlastingBugstopper
Copy link
Contributor Author

I'm not sure actually - would need to see how it all works. My guess is yes - but we'd attempt to achieve parity with whatever node does.

@stale
Copy link

stale bot commented Jul 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 5, 2020
@EverlastingBugstopper EverlastingBugstopper added the dev `wrangler dev` label Jul 16, 2020
@EverlastingBugstopper EverlastingBugstopper removed this from the wrangler dev milestone Jul 16, 2020
@stale
Copy link

stale bot commented Sep 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 15, 2020
@ispivey ispivey removed the wontfix label Sep 16, 2020
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

@stale stale bot added the timed out label Jun 2, 2021
@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically closed because it has not had recent activity. You may re-open the issue if it is still relevant.

@stale stale bot closed this as completed Jun 11, 2021
@ObsidianMinor ObsidianMinor reopened this Jul 7, 2021
@stale stale bot removed the timed out label Jul 7, 2021
@Electroid Electroid linked a pull request Jul 28, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dev `wrangler dev` feature Feature requests and suggestions never stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants