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

devtools/vscode debugging fails kj/compat/http.c with Message is too large (>1MB) #1563

Closed
kavika-1 opened this issue Jan 22, 2024 · 4 comments · Fixed by #1573
Closed

devtools/vscode debugging fails kj/compat/http.c with Message is too large (>1MB) #1563

kavika-1 opened this issue Jan 22, 2024 · 4 comments · Fixed by #1573

Comments

@kavika-1
Copy link

Using either the remix cloudflare workers or pages template out of box on WSL2 linux. Trying to debug locally, setting a breakpoint. Breakpoint is hit, but then emits the error listed below, after which the session is broken. Chrome devtools and vscode run into the same issue.

After investigating, it seems to have to have to do with the size of certain chunks that remix emits, as well as map files, which are clearly greater than 1MB. Apparently these are sent via WebSocket? Minifying the build reduced that file to under 300K, and debugging breakpoints works again.

Can't find a way to ask remix to chunk that piece any smaller. Would it make sense when running locally to allow larger messages to improve the worker/pages developer experience? Even if behind an option/flag?

✘ [ERROR] workerd/jsg/util.c++:281: error: e = kj/compat/http.c++:5618: failed: WebSocket protocol error; protocolError.statusCode = 1009; protocolError.description = Message is too large: 2157260 > 1048576

stack: /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35bf930 /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35bfb7a /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@48f24cf /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2c10ba0 /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@35dddc0 /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2c10ba0 /home/david/github/plg-perf-app-cfp/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2e1932c; sentryErrorContext = jsgInternalError

kentonv added a commit that referenced this issue Jan 23, 2024
Since this is for debugging only, we don't really need to be so strict.

Fixes #1563.
@kentonv
Copy link
Member

kentonv commented Jan 23, 2024

Oh this looks like an easy fix -- #1573.

@kavika-1
Copy link
Author

Wow - so much appreciated!

@erkkah
Copy link

erkkah commented Apr 9, 2024

I still get this in v1.20240404.0, which is super-strange. The inspector service closes down and devtools (chrome / vscode) hangs. From the code, it looks like it should be fixed.

workerd/jsg/util.c++:291: error: e = kj/compat/http.c++:5754: failed: WebSocket protocol error; protocolError.statusCode = 1009; protocolError.description = Message is too large: 1111947 > 1048576

Also, when the error is reported, it prints garbage, since the id is no longer valid:

✘ [ERROR] workerd/server/server.c++:1230: info: Inspector client detached [|�^k�NF0�@^o�m�NF �v�,�	]

@erkkah
Copy link

erkkah commented Apr 9, 2024

After a bit of debugging - it seems this happens for capn-protoed cdp messages between workerd:s?. I have a setup with a bunch of DurableObjects (<20) - if I reduce the number of registered namespaces, everything works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants