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

ErrorStackParser is not defined #358

Open
patrickdemooij9 opened this issue Sep 12, 2024 · 1 comment
Open

ErrorStackParser is not defined #358

patrickdemooij9 opened this issue Sep 12, 2024 · 1 comment

Comments

@patrickdemooij9
Copy link

Hi!

Running into an issue with the Errors plugin and I am not quite sure if this is my fault or if something is broken. I enabled sendAfterOnload on the config and added

setTimeout(() => {
	console.error("Test2");
}, 1000);

to test if it would be picked up. But I then run into this issue:
image

Adding a debug point, it indeed cannot find the ErrorStackParser and looking at where the ErrorStackParser is defined doesn't really tell me how this is supposed to work.

@nicjansma
Copy link

Hi @patrickdemooij9!

ErrorStackParser should be "bundled" (inline) in the errors.js plugin.

When the errors.js plugin is loaded, it should execute this block which would register a global ErrorStackParser (e.g. on window):

(function (root, factory) {
  'use strict';
  root.ErrorStackParser = factory();
}(this, function ErrorStackParser() {
  // <-- ErrorStackParser code here
});

Is this when this function is executed something other than the global root / window object?

If the whole plugin or boomerang.js is wrapped in another object, that could be changing the this and registering ErrorStackParser onto something else.

We could probably be smarter about where we register ErrorStackParser here, maybe just inline into the BOOMR. namespace so there's no potential conflicts or writing it onto something unexpected.

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

No branches or pull requests

2 participants