question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Some functionality can only be performed while handling a request" whenever running in a debugger

See original GitHub issue

My project runs fine using a regular start/dev command. However, whenever a debugger from VSCode or WebStorm attaches itself to the process, all requests subequently fail with

GET /myurl 500 Internal Server Error (22891.94ms)
[mf:err] GET /myurl: Error: Some functionality, such as asynchronous I/O (fetch, Cache API, KV), timeouts (setTimeout, 
setInterval), and generating random values (crypto.getRandomValues, crypto.subtle.generateKey), can only be performed wh
ile handling a request.

I am 100% certain that my code is not doing any i/o outside of its main request handler. How can we help to reproduce this, as in #207 the same issue occurs?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mrbbotcommented, Jul 2, 2022

Hey! 👋 Thanks for reporting this. I’m able to reproduce it and will investigate further. Will aim to fix in the next release.

0reactions
mrbbotcommented, Sep 13, 2022

Hey again! Looks like this fix was released as part of Node 18.9.0. Upgrading should resolve this issue! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

CloudFlare Workers - some functionality can only be ...
I ran into it recently when tying to deploy what I thought should be a relatively simple function.
Read more >
Debugging uncaught requests - Recipes - Mock Service Worker
Debugging uncaught requests · Enable onUnhandledRequest option · Examine the handlers · Verify the worker's scope · Run in debug mode.
Read more >
In the VS Code "Debug Console", run a JavaScript await ...
The issue here is that running a microtask queue during a debug break heavily violates regular behavior of the web page. When you...
Read more >
Manage exceptions with the debugger in Visual Studio
Tell the debugger to break when an exception is thrown ... The debugger can break execution at the point where an exception is...
Read more >
Debugging in Visual Studio Code
Many debuggers support some of the following attributes: program - executable or file to run when launching the debugger; args - arguments passed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found