Skip to content

Conversation

beerose
Copy link

@beerose beerose commented Oct 20, 2023

currently running analyze-trace with --json flag results in:

Internal Error: undefined is not iterable (cannot read property Symbol(Symbol.iterator))\nTypeError: undefined is not iterable

(getHotSpotsWorker can return undefined in some cases)

@@ -111,7 +111,7 @@ async function getHotSpotsWorker(curr: EventSpan, currentFile: string | undefine
// Sort slow to fast
const sortedChildren = curr.children.sort((a, b) => (b.end - b.start) - (a.end - a.start));
for (const child of sortedChildren) {
children.push(...await getHotSpotsWorker(child, currentFile, positionMap, relatedTypes, importExpressionThreshold));
children.push(...(await getHotSpotsWorker(child, currentFile, positionMap, relatedTypes, importExpressionThreshold) || []));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be possible; the return type is declared as Promise<HotFrame[]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants