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

fix(browser): Strip webpack wrapping from stack frames #5522

Merged

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Aug 4, 2022

Fixes #5459

I did try and solve this via the Chrome regex but found that the 2nd line ((error: https://s1.sentry-cdn.com/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js)) was picked up by the gecko parser. This change just strips the (error: *) wrapper from all lines before parsing proper. Line 2 is still parsed by the gecko parser but the resulting frame seems sensible even if it doesn't contain much useful info.

The following stack string:

ChunkLoadError: Loading chunk app_bootstrap_initializeLocale_tsx failed.
      (error: https://s1.sentry-cdn.com/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js)
        at (error: (/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js))
        at key(webpack/runtime/jsonp chunk loading:27:18)
        at ? (webpack/runtime/ensure chunk:6:25)
        at Array.reduce(<anonymous>)

Now results in the following frames:

        [ 
          { 
            filename: '<anonymous>', 
            function: 'Array.reduce', 
            in_app: true 
          },
          {
            filename: 'webpack/runtime/ensure chunk',
            function: '?',
            in_app: true,
            lineno: 6,
            colno: 25,
          },
          {
            filename: 'webpack/runtime/jsonp chunk loading',
            function: 'key',
            in_app: true,
            lineno: 27,
            colno: 18,
          },
          {
            filename: '/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js',
            function: '?',
            in_app: true,
          },
          {
            filename: 'https://s1.sentry-cdn.com/_static/dist/sentry/chunks/app_bootstrap_initializeLocale_tsx.abcdefg.js',
            function: '?',
            in_app: true,
          },
        ]

@AbhiPrasad AbhiPrasad merged commit ee4d165 into getsentry:master Aug 4, 2022
@timfish timfish deleted the fix/webpack-wrqpped-stack-trace branch October 5, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Stack trace link to URL picking up trailing parenthesis
2 participants