Skip to content

Inline scripts errors does not have any references. #1140

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

Closed
tkiefer24 opened this issue Jan 18, 2022 · 3 comments · Fixed by #1239
Closed

Inline scripts errors does not have any references. #1140

tkiefer24 opened this issue Jan 18, 2022 · 3 comments · Fixed by #1239
Assignees
Labels

Comments

@tkiefer24
Copy link

The following error on a page with (Chromium 97, I can see in the logs other browsers also affected):
image
is tracked as the following payload:
image
I already tryed the error-stack-parser version 2.x to solve this issue, it does not work!
It would be good to see the filename and lineno property in the logged error message.
I hope someone can fix this.
Thanks,
Timo

@devcorpio
Copy link
Contributor

devcorpio commented Jan 18, 2022

Hi @tkiefer24,

After investigating I found out that error-stack-parser might have a bug.

        parse: function ErrorStackParser$$parse(error) {
            if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {
                return this.parseOpera(error);
            } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {
                return this.parseV8OrIE(error);
            } else if (error.stack) {
                return this.parseFFOrSafari(error);
            } else {
                throw new Error('Cannot parse given Error object');
            }
        },

For instance:

  • if the inline script error happens in Chrome, the logic executed by the library is parseFFOrSafari
  • if the inline script error happens in Firefox, the library throws an error and the agent is extracting the stack directly from the value of the ErrorEvent

It is something that we should handle in the agent. An example could be using the lineno,filename and colno as a fallback when creating the stackframe but is something that requires more investigation.

Apart from that, I will open an issue in error-stack-parser repo

Thanks for bringing this to our notice!

@devcorpio devcorpio added the bug label Jan 18, 2022
@tkiefer24
Copy link
Author

@devcorpio mh.. to me it looks more than that the error-stack-parser only got the error property from the ErrorEvent, so it has not enough data that and could not extract filename and lineno information.

@devcorpio devcorpio self-assigned this Jun 2, 2022
@devcorpio
Copy link
Contributor

Hi @tkiefer24,

The release with the fix is now available

Cheers,
Alberto

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

Successfully merging a pull request may close this issue.

2 participants