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]!; 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();