Skip to content

Simplified file path in event/issue display #60627

@niksy

Description

@niksy

Problem Statement

Currently, stack trace filename is displayed like this, with absolute filename path display by default:
Screenshot 2023-11-24 at 10 13 03

I wanted to simplify filename display to strip common directory from all filenames so I used RewriteFrames integration. Using root and prefix options always show "source not found" notification so I thought it’s related to source maps.
These are source files so there isn’t any source map to upload (as it can be seen from first screenshot, vanilla JS files only).

I thought this could be achieved if I added abs_path field to frame inside iteratee callback:

{
  integrations: [
    new RewriteFrames({
      iteratee: (frame) => {
        frame["abs_path"] = frame.filename;
        frame.filename = frame.filename.replace(projectRoot, "");
        return frame;
      },
    }),
  ],
}

But this also shows "source not found" notification:
Screenshot 2023-11-24 at 10 12 23

What I did achieve is I managed to strip project root from filename, with absolute path displayed in tooltip - but still no original source code:
Screenshot 2023-11-24 at 10 12 13

Is it possible to achieve something like this without resorting to source map upload since there aren’t any source maps to upload?

Solution Brainstorm

PHP/Symfony integration already has this implemented and shows tooltip with absolute path to filename while still displaying simplified path to filename and original source code. Maybe use approach from there to achieve this?

Product Area

Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeaturejavascriptPull requests that update javascript code

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions