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.

Long delay before callback gets called after StackTrace.fromError()

See original GitHub issue

Hello,

I’ve noticed that there is a significant delay for resolving the callback, about 15-70s between the time I do the call to StackTrace.fromError and the time the callback actually gets called.

I have an angular project, and to reproduce the issue I simply add the following line when booting up the app:

console.log('calling fromError');
StackTrace.fromError(new Error(), { sourceCache : {}}).then(function() { console.log('first source map done')});

results in

2017-04-26 10:09:39.989  calling fromError
2017-04-26 10:09:55.197  first source map done

Looking at what happens in the Chrome’s Network tab, it looks like only one call to getting the sourceMaps is done (though subsequent calls to fromError will generate more requests to get the sourceMaps, they are taken from the cache so it doesn’t seem to be an issue, and at least not relevant to the one at hand here).

Removing the source maps from the compilation solves the issue (less than 1s delay), so it seems to be linked with sourcemap loading or resolving.

I’m testing in local, so downloading the ~2-4MB sourcemaps is fast (and I also reproduce the latency when getting the sourcemaps from cache), so I assume it’s the parsing that takes time.

Is there anything you know I could do to speed up this process? I’m using stacktrace parsing to send notifications on Slack when something goes wrong, and I’m worried the user might close the window before the full processing is done if it takes too long.

Thanks for your help!

Sébastien

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rquastcommented, May 5, 2018

Great library but experienced the same issues with the UI freezing. Wouldn’t mind a webworker solution if anyone can figure it out.

0reactions
odusseyscommented, Jun 23, 2017

I’d like to notify that we are running into the same problem with disastrous results. Calls to _parseMappings are making the entire UI freeze for upwards of 8 seconds in severe cases. We have been forced to remove stacktracejs as a consequence.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing an async function as a callback causes the error stack ...
Missing stack trace has nothing to do with Promises. Write the same code that has functions calling each other in synchronous way and...
Read more >
stacktrace-js | Yarn - Package Manager
Debug and profile your JavaScript with a stack trace of function calls leading to an error (or any condition you specify).
Read more >
Errors | Node.js v19.3.0 Documentation
readFile() is called asynchronously. By the time the callback has been called, the surrounding code, including the try…catch block, will have already exited....
Read more >
Error Explanations - Bluebird JS
The function being called expects a Promise, but is given something different. ... When debugging or performing a one-time operation on a variable...
Read more >
How We Made JavaScript Stack Traces Awesome - Sentry Blog
In this blog post, we want to explain why source maps are ... function names in a stack trace would be the primary...
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