You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: Cannot find symbol for node: replace
at TypesUsageEvaluator.getSymbol (src/types-usage-evaluator.ts:128:10)
at TypesUsageEvaluator.computeUsagesRecursively (src/types-usage-evaluator.ts:107:52)
at TypesUsageEvaluator.computeUsageForNode (src/types-usage-evaluator.ts:72:9)
at visitNodes (node_modules/typescript/lib/typescript.js:31214:30)
at forEachChildInSourceFile (node_modules/typescript/lib/typescript.js:31573:20)
at Object.forEachChild (node_modules/typescript/lib/typescript.js:31988:47)
at TypesUsageEvaluator.computeUsages (src/types-usage-evaluator.ts:60:7)
at new TypesUsageEvaluator (src/types-usage-evaluator.ts:18:8)
at generateDtsBundle (src/bundle-generator.ts:149:30)
at Context.<anonymous> (tests/e2e/all-test-cases.ts:68:39)
at processImmediate (node:internal/timers:464:21)
error thrown from here:
private getSymbol(node: ts.Node): ts.Symbol {
const nodeSymbol = this.typeChecker.getSymbolAtLocation(node);
if (nodeSymbol === undefined) {
throw new Error(`Cannot find symbol for node: ${node.getText()}`); // <---- this line
}
return this.getActualSymbol(nodeSymbol);
}
I have no idea why getSymblAtLocation return undefined under these conditions.
to re-produce the error, the following code is key-point: in the react-router-dom,
the second parameter must have the question mark ?
replace rename to replaceProp
to fix this, maybe try to avoid put BindingElement's propertyName into the queue, for example:
privatecomputeUsagesRecursively(parent: ts.Node,parentSymbol: ts.Symbol): void{// ...if(ts.isIdentifier(child)){// identifiers in labelled tuples don't have symbols for their labels// so let's just skip them from collectingif(ts.isNamedTupleMember(child.parent)&&child.parent.name===child){continue;}// ADD THIS: do not put BindingElement( {a: b} )'s propertyName into queue.if(ts.isBindingElement(child.parent)&&child===child.parent.propertyName){continue;}}// ...}Pleasetakealookandexpectingreplies.
The text was updated successfully, but these errors were encountered:
Bug report
Input code
Expected output
Actual output
error thrown with message:
error thrown from here:
I have no idea why
getSymblAtLocation
returnundefined
under these conditions.to re-produce the error, the following code is key-point: in the react-router-dom,
?
replace
rename toreplaceProp
to fix this, maybe try to avoid put BindingElement's propertyName into the queue, for example:
The text was updated successfully, but these errors were encountered: