-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Visitor throws Cannot read property 'kind' of undefined using [email protected]Β #38558
Copy link
Copy link
Closed
Description
TypeScript Version:
- π΄
3.9.2 - π΄
3.9.1-rc - π΄
3.9.0-beta - β
3.8.3(it work with previous versions)
Search Terms:
Visitor TypeError kind undefined 85032
Code
Unknown (Error is thrown at node_modules/typescript/lib/typescript.js:85032:35)
But this part triggers it
export interface ColorProps {
style?: CSSProperties
}
const Color = styled(({ style }: ColorProps) => (
<div
style={{
...style,
background: `anything`,
}}
/>
))``Expected behavior:
It compiles
Actual behavior:
TypeError: Cannot read property 'kind' of undefined
at visitObjectLiteralExpression (node_modules/typescript/lib/typescript.js:85032:35)
at visitJavaScript (node_modules/typescript/lib/typescript.js:83441:28)
at visitor (node_modules/typescript/lib/typescript.js:83384:24)
at visitNode (node_modules/typescript/lib/typescript.js:74768:23)
at Object.visitEachChild (node_modules/typescript/lib/typescript.js:75209:108)
at visitJavaScript (node_modules/typescript/lib/typescript.js:83491:31)
at visitor (node_modules/typescript/lib/typescript.js:83384:24)
at visitNodes (node_modules/typescript/lib/typescript.js:74819:48)
at Object.visitEachChild (node_modules/typescript/lib/typescript.js:75034:53)
at visitObjectLiteralExpression (node_modules/typescript/lib/typescript.js:85057:23)
Playground Link:
- minimal reproducible repository - https://github.com/lukaskl/typescript-visitor-bug-report
Related Issues:
- TypeError: Cannot read property 'kind' of undefinedΒ #38383, this report could be duplicate of TypeError: Cannot read property 'kind' of undefinedΒ #38383, however, the error message is really a generic one and this error is thrown at a completely different place - therefore, for me it seems like a different issue (sorry in advance if this will turn out as a duplicate π).
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript