From f962b56c6f766fd0ea012c258042d3e4bb87eb8a Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 15 Apr 2026 13:27:15 -0700 Subject: [PATCH 1/2] fix(stack-trace): Show for frames with no filename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit frames with no filename or module were rendering a bare `:5:20` in the path slot, which looked terrible. now falls back to a muted `` label (no line number — not meaningful without a file to anchor it to). --- .../stackTrace/frame/frameHeader.tsx | 12 +++++-- .../components/stackTrace/stackTrace.spec.tsx | 31 +++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/static/app/components/stackTrace/frame/frameHeader.tsx b/static/app/components/stackTrace/frame/frameHeader.tsx index 6f17ae78c07a3b..b98383cf30dd80 100644 --- a/static/app/components/stackTrace/frame/frameHeader.tsx +++ b/static/app/components/stackTrace/frame/frameHeader.tsx @@ -141,8 +141,16 @@ function FrameLocation({ - {frameDisplayPath} - {frameLocationSuffix ? {frameLocationSuffix} : null} + {frameDisplayPath ? ( + {frameDisplayPath} + ) : ( + + {t('')} + + )} + {frameDisplayPath && frameLocationSuffix ? ( + {frameLocationSuffix} + ) : null} diff --git a/static/app/components/stackTrace/stackTrace.spec.tsx b/static/app/components/stackTrace/stackTrace.spec.tsx index b437f090a3aac8..8ea7eadf16e1f3 100644 --- a/static/app/components/stackTrace/stackTrace.spec.tsx +++ b/static/app/components/stackTrace/stackTrace.spec.tsx @@ -724,6 +724,37 @@ describe('Core StackTrace', () => { expect(screen.queryByText('MainActivity.java')).not.toBeInTheDocument(); }); + it('renders with line number when frame has no filename or module', async () => { + const {event, stacktrace} = makeStackTraceData(); + const frame = stacktrace.frames[stacktrace.frames.length - 1]!; + + render( + + + + ); + + expect(await screen.findByText('')).toBeInTheDocument(); + expect(screen.queryByText(':5:20')).not.toBeInTheDocument(); + }); + it('does not render line number when lineNo is zero', async () => { const {event, stacktrace} = makeStackTraceData(); const frame = stacktrace.frames[stacktrace.frames.length - 1]!; From cb66e04d873a0224d6833c734883b28d3035bf1a Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 15 Apr 2026 13:43:38 -0700 Subject: [PATCH 2/2] docs(stack-trace): Add story for frames with no filename --- .../stackTrace/stackTrace.stories.tsx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/static/app/components/stackTrace/stackTrace.stories.tsx b/static/app/components/stackTrace/stackTrace.stories.tsx index db1e4eb91f7126..b728bd2b5ad293 100644 --- a/static/app/components/stackTrace/stackTrace.stories.tsx +++ b/static/app/components/stackTrace/stackTrace.stories.tsx @@ -1002,6 +1002,41 @@ export default Storybook.story('StackTrace', story => { ); }); + story('StackTraceProvider - No Filename', () => { + const event = makeEvent({platform: 'javascript', projectID: '1'}); + const stacktrace: StacktraceWithFrames = { + framesOmitted: null, + hasSystemFrames: false, + registers: {}, + frames: [ + makeFrame({ + filename: null, + module: null, + absPath: null, + function: 'eval', + lineNo: 5, + colNo: 20, + inApp: true, + }), + ], + }; + + return ( + +

+ Frames with no filename or module (e.g. browser eval) show a muted{' '} + {''} in the path slot. +

+ + + +
+ ); + }); + story('StackTraceProvider - Raw Function and Package', () => { const {event, stacktrace} = makeRawFunctionAndPackageStackTraceData();