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

[wrangler 2.0.5] Devtools is broken on a newly created template project #1016

Closed
bdunderscore opened this issue May 15, 2022 · 4 comments
Closed
Labels
bug Something that isn't working

Comments

@bdunderscore
Copy link

🐛 Bug report

Describe the bug

After creating a new typescript worker with npx wrangler init, and running npm start with no changes, devtools fails to initialize.

Reproduce the bug

  1. npm i wrangler@beta -g
  2. npx wrangler init avrc-backend-worker
  3. cd avrc-backend-worker
  4. npm start
  5. Press d

Expected behavior

Devtools should open and connect.

Actual behavior

Devtools opens, but fails to connect. If I open the browser devtools and look in the console, there are errors that look like:

Protocol Error: the message with wrong id: {"id":2,"result":{"id":"f218df53bf0d4a12"}}
reportProtocolError @ InspectorBackend.ts:122

Environment and versions

Fill out the following information about your environment.

  • operating system: Windows 11
  • output of wrangler -V:
PS C:\Users\bd\src\avrc\avrc-backend-worker> wrangler -V

wrangler

Commands:
  wrangler init [name]       📥 Create a wrangler.toml configuration file
  wrangler dev [script]      👂 Start a local server for developing your worker
  wrangler publish [script]  🆙 Publish your Worker to Cloudflare.
  wrangler tail [name]       🦚 Starts a log tailing session for a published Worker.
  wrangler secret            🤫 Generate a secret that can be referenced in the worker script
  wrangler kv:namespace      🗂️  Interact with your Workers KV Namespaces
  wrangler kv:key            🔑 Individually manage Workers KV key-value pairs
  wrangler kv:bulk           💪 Interact with multiple Workers KV key-value pairs at once
  wrangler pages             ⚡️ Configure Cloudflare Pages
  wrangler r2                📦 Interact with an R2 store
  wrangler login             🔓 Login to Cloudflare
  wrangler logout            🚪 Logout from Cloudflare
  wrangler whoami            🕵️  Retrieve your user info and test your auth config

Flags:
  -c, --config   Path to .toml configuration file  [string]
  -h, --help     Show help  [boolean]
  -v, --version  Show version number  [boolean]

X [ERROR] Unknown argument: V


PS C:\Users\bd\src\avrc\avrc-backend-worker> wrangler -v
2.0.5
  • output of node -v:
PS C:\Users\bd\src\avrc\avrc-backend-worker> node -v
v16.13.2
  • content of wrangler.toml:
PS C:\Users\bd\src\avrc\avrc-backend-worker> cat .\wrangler.toml
name = "avrc-backend-worker"
main = "src/index.ts"
compatibility_date = "2022-05-15"
@bdunderscore bdunderscore added the bug Something that isn't working label May 15, 2022
@threepointone threepointone transferred this issue from cloudflare/wrangler-legacy May 15, 2022
@threepointone
Copy link
Contributor

Sorry about this. We're going to work on making our devtools integration better. That particular error should be fine for now, it shouldn't break anything. Could you tell me what browser you use? And where did you open the browser devtools? Thanks!

@bdunderscore
Copy link
Author

I use chrome 101.0.4951.54 on Windows 11 Version 21H2, running on the same host that is running wrangler dev.

@bdunderscore
Copy link
Author

bdunderscore commented May 16, 2022

It does seem that the REPL works, but I'm unable to directly open any of my source code in the sources tab, so I can't set breakpoints (hence why I initially thought it was completely broken).

On further investigation, it's possible to open source code by clicking on file names in backtraces, but setting breakpoints does not seem to be effective.

@petebacondarwin
Copy link
Contributor

This is a known limitation. We only support displaying console log messages in the DevTools. We are working on adding debugging support. See #188.

I think this is working as expected, right now. Please follow along with #188 to see progress on better DevTools experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants