-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Generic React HOC: TypeError: Cannot read property 'declarations' of undefined
#41616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using |
we also get this error on our production React app at @LeapLabs |
I get the same issue in simple Button component code when i set "jsx" to "react-jsx" in tsconfig, even if i simplify it to this const Element = 'button';
return (
<Element
//some props
/>
) Returning just |
Could someone perhaps tell me in which version this was introduced so I can downgrade typescript again as minimal as possible? |
TypeScript Version: 4.1.2
Search Terms: TypeError Cannot read property declarations of undefined
Code
src-file1.tsx
:src-file2.tsx
:Expected behavior:
Both
npx tsc --strict --noEmit --jsx 'react' src-file1.tsx
andnpx tsc --strict --noEmit --jsx 'react' src-file2.tsx
will run successfully.Actual behavior:
npx tsc --strict --noEmit --jsx 'react' src-file2.tsx
runs successfully, butnpx tsc --strict --noEmit --jsx 'react' src-file1.tsx
fails with the error message (where"$PWD"
is the present working directory and"$HOME"
is my home directory):Playground Link:






Compiling the first source file crashes the web compiler,
while compiling the second source file succeeds.
Related Issues:
#33735 #21817 #21811 #21798 #20475 #6428
The text was updated successfully, but these errors were encountered: