File tree 1 file changed +8
-4
lines changed
static/app/views/insights/pages/platform/nextjs 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ import {useTransactionNameQuery} from 'sentry/views/insights/pages/platform/shar
38
38
39
39
interface TreeResponseItem {
40
40
'avg(span.duration)' : number ;
41
- 'function.nextjs.component_type' : string ;
41
+ 'function.nextjs.component_type' : string | null ;
42
42
'function.nextjs.path' : string [ ] ;
43
43
'span.description' : string ;
44
44
}
@@ -99,9 +99,13 @@ export function mapResponseToTree(response: TreeResponseItem[]): TreeContainer {
99
99
const path = item [ 'function.nextjs.path' ] ;
100
100
let currentFolder : TreeContainer = root ;
101
101
102
- const { file, functionName} = getFileAndFunctionName (
103
- item [ 'function.nextjs.component_type' ]
104
- ) ;
102
+ // Custom spans with span.op:function.nextjs will not have a component type and cannot be added to the tree
103
+ const componentType = item [ 'function.nextjs.component_type' ] ;
104
+ if ( ! componentType ) {
105
+ continue ;
106
+ }
107
+
108
+ const { file, functionName} = getFileAndFunctionName ( componentType ) ;
105
109
106
110
const fullPath = [ ...path ] ;
107
111
if ( file ) {
You can’t perform that action at this time.
0 commit comments