Skip to content

RewriteFrames not functional in browser environments #6423

Closed
@segevfiner

Description

@segevfiner

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/vue

SDK Version

7.23.0

Framework Version

Vue 3.2.40

Link to Sentry event

https://sentry.io/organizations/swimm/issues/3788945788/events/387150439b9a4cb787c4582e97bd40ae/?project=4504236048646144&query=is%3Aunresolved&referrer=previous-event

Steps to Reproduce

We have a virtual server (Inside a VS Code webview, they use a ServiceWorker to simulate it internally), that hosts our assets under a dynamic subdirectory, which is in fact the full path to the file on the users system. As such the filenames in the reported Sentry stack traces include prefix and don't match the uploaded source maps which are uploaded without it. As it is dynamic, I can't just use urlPrefix, so as in similar cases I tried to use RewriteFrames to normalize the uploaded paths to match the actual root Sentry knows about. But... RewriteFrames doesn't do anything in the browser by default when just specifying root, and it looks like I'll have to write my own iteratee. This is not very convenient. I'd rather it just worked given the proper root path to strip even in browser context.

Steps to Reproduce:

  1. Install Sentry in any web project hosted in a web server subdirectory, yet don't use urlPrefix, instead try to use RewriteFrames to normalizes the paths.

Expected Result

RewriteFrames should support such scenarios.

Actual Result

It doesn't do anything due to the check at

if (isWindowsFrame || startsWithSlash) {
, as it doesn't know how to handle URLs instead of paths.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions