-
-
Notifications
You must be signed in to change notification settings - Fork 433
Missin imports in TS 2.3 / JSX #538
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
Hi @olmobrutall, Thanks for the detailed issue. I haven't had any issues using 2.3 myself and as far as I know things should just work. I don't know why your setup is experiencing this - it might be work comparing that with one of the ts-loader examples and seeing if they face the same issue. |
I've isolated in my solution and only happens on JSX elements that have ellipsis ( I've been trying to reproduce it in Is there any ways ts-loader could show some intermediate state to debug it easily? |
Probably the easiest thing to do is build a copy of ts-loader yourself and thread in console.log statements as and where you need them. I've had good results with that in the past. |
Problem found, checking the code and adding some console.log I was able to isolate the problem. It's a Typescript problem that happens only when That's why it didn't happen in your examples or when I was compiling without ts-loader. I'll raise an issue in Typescript now, Thanks for your help 👍 |
Happy to help! |
This thing is fixed now in 2.3.4, feel free to close. Thanks for the help |
Hi guys,
I have a problem updating to TS 2.3 and using JSX: looks like some imports are removed.
I've been spending some time to track it down and looks like it's a ts-loader problem, because running
tsc
withnoEmit: false
generates the right files, but ts-loader removes some imports.AFAIK, looks like the imports are removed when they are relative file paths and/or only used in JSX expressions.
TS Source code in Github:
(Problematic file in Submodule)
https://github.com/signumsoftware/framework/blob/bb6965f60fbebca1ecb4ecf4277bf38275965d99/Signum.React/Scripts/Lines/Typeahead.tsx
(Application with webpack.config)
https://github.com/signumsoftware/southwind/tree/master/Southwind.React
TS Source code simplification
Generated js using tsc only
Generated Webpack using ts-loader
Is TS 2.3 already supported, or are there any plans to do it?
Thanks for your great work.
The text was updated successfully, but these errors were encountered: