-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(integrations): Handle windows paths with no prefix or backslash prefix in RewriteFrames
#7995
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(integrations): Handle windows paths with no prefix or backslash prefix in RewriteFrames
#7995
Conversation
…refix in `RewriteFrames` Forward slashes are not allowed in Windows paths. This extends RewriteFrames to detect additional Windows-like paths and convert them to use forward slashes.
Hi @srubin thanks for opening this PR! On first glance this looks good to me. Gonna let CI run to check for tests. Just out of curiousity, is this something that you need for your use case? Under which circumstances do such frames occur? And furthermore, is there an open issue around this? (if not, that's alright, I just want to ensure we link things appropriately). |
We were running into this problem with source maps generated on Windows in webpack. However, I found that I could fix this in our webpack config by standardizing the path separators in devtoolModuleFilenameTemplate. There's not an open issue around this, and we're not blocked on the fix in this PR. For us it's cleaner to address it upstream (in our webpack config) anyway. So, no complaints if you close this PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!
Makes sense to me. I'm okay to merge this but it'd be great if you could look into the polynomial regex warning (just to confirm, can you see the CodeQL warning? Not sure about our repo settings here). Any chance that you could come up with a more efficient regex? Considering that this runs for every stack frame I'd like to avoid a potential performance bottleneck (stack trace parsing is already quite resource-intensive as-is).
1e7cf79
to
1f1a00d
Compare
Updated to use string.includes instead. I had to force push to change a commit message to use the |
No worries, force push is not a problem (we do it all the time 😅). I restarted CI |
@srubin can you run |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, then let's merge this. Thanks for contributing @srubin!
…refix in `RewriteFrames` (#7995) Forward slashes are not allowed in Windows paths. This fix extends RewriteFrames to detect additional Windows-like paths and convert them to use forward slashes.
Forward slashes are not allowed in Windows paths. This extends RewriteFrames to detect additional Windows-like paths and convert them to use forward slashes.
Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint
) & (yarn test
).