Release 3.8.0 of the TrackJS browser agent added support for Web Workers, which adds some awesome new observability to the background tasks of your web applications.

Many development teams have adopted Web Workers to their web applications to add offline support, caching, or to process heavy tasks. Workers allow web apps to feel faster by removing work from the user interface thread.

But workers are still written in JavaScript, and they still operate in hostile end user browser environments over networks that may not be as reliable as we’d like. Errors will happen.

Enter our hero, TrackJS.

By adding the TrackJS agent to your web workers, you’ll get visibility into all types of errors from your worker processes. Errors like:

  • Globally thrown errors, like Cannot read property 'length' of undefined.
  • Unhandled promise rejections, like TypeError: Failed to Fetch.
  • Network error responses, like 503 : https://example.com/.
  • Caught errors from callbacks, like undefined is not an object.
  • Direct or console error messages that you want to pass from your code.

You’ll know right away when there is a problem with your code. Plus, you’ll be able to observe exactly what was happening in the worker thread before the error happened. TrackJS Telemetry in worker threads includes:

  • Method, URL, and time of all network requests.
  • All console messages.
  • Custom metadata about your environment and session.

Plus you’ll get all the great search, filtering, enrichment, and ignore capability that you get with any TrackJS account. Go give it a try today and let us help you build better web applications.

Did you like this?
CEO TrackJS
Todd is a software engineer, business leader, and developer advocate with 20+ years of experience. He is a co-founder and CEO of TrackJS and Request Metrics,...

What to do Next:

1. Try TrackJS on Your Website

TrackJS gives you the visibility to find and fix your errors before users find them. Get started in 5 minutes tracking errors with all the context you'll need to squash the important bugs in your app.

2. Get the Debugger Newsletter

Join The Debugger for amazing JavaScript tips, debugging walkthroughs, news, and product releases for Request Metrics. No more than once a week, probably a lot less.