-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Problem with required TS. #13656
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
The error was added to let users know that the compilation produced no outputs, since it had no inputs. some of the common mistakes is having a conflicting for your scenario, i would recommend using configuration inheritance instead, in each project that needs typescript, add a tsconfig.json, that extends from your main config file. Alternatively, add a condition on your build task to not call the build unless |
Why not just build in an option to not check for this issue? |
We have a limited budget for new compiler options. adding new options increases complexity for both users and maintainers. |
However this change is making it more difficult for your users! I am unsatisfied with this answer. |
In short you want an option that will allow the TypeScript compiler to run without doing anything. Please reconsider why you are even running the compiler in these directories. This is a problem in your setup and not TypeScript.
|
For some reason when I create a new VS solution without having any C# files to compile, the compiler builds without throwing exceptions. This works with almost every other programming language out there. Team Typescript for some reason thinks they are better then everyone else and added a feature that is detrimental to its users. This is the kind of stupidy that kills successful projects. The programmer is a fickle one and loyalty runs only as long as your tool is best for the job... when you add stupid things like this that loyalty drops. At this point Typescript is best but I won't be pushing for it next time we make technology choices... the sad part is that this is an uber simple change that would have taken a dev less than 2 hours to implement. Instead you've created negativity around this project with the unyielding approach to user requests... very sad. |
Not really. FWIW there is precedence in the JavaScript community e.g. mocha gives a much more horrible experience: Personally I am happy with what the TypeScript team has done. Of course that is just my opinion 🌹 |
I had a similar question but this issue answered it. I'm not the sappy type but I just wanted to say that I, as well as other developers that I know, love TypeScript. You guys do a great job. I don't know why some people feel entitled and demand things from open source maintainers. I'm really hoping the one(s) that got bent out of shape read this comment. TypeScript is open source. The TypeScript team is great and I look forward to using them on every JavaScript project I have, whether it's 100% perfect (NOT a reality for ANY software/language/framework/library/OSS) or it has it's flaws. As a side note, wouldn't the error go away after a .ts or .tsx file is created? I deleted my .tsconfig.json, rewrote it, and it worked perfectly. Initially, I wrote my tsconfig.json without a .ts or .tsx file, added a file, and the issue still persisted. Similar to the OP but a little different. |
can you share a sample project? |
Here's a basic boilerplate project that I just started. I've never worked with Webpack & TypeScript together. I'm sure it has something to do with that. Also, I've never worked with TypeScript and React together. And finally, my code sucks. It's incomplete. I'll add more to it later. |
not sure i see the issue.. this is what i am seeing: c:\test\13656>git clone https://github.com/iamclaytonray/webpack-with-react.git
c:\test\13656>cd webpack-with-react
c:\test\13656\webpack-with-react>npm install
c:\test\13656\webpack-with-react>node_modules\.bin\tsc
src/app/AppIndex.tsx(5,39): error TS2314: Generic type 'Component<P, S>' requires 2 type argument(s).
src/app/AppIndex.tsx(9,10): error TS2604: JSX element type 'Header' does not have any construct or call signatures.
src/app/AppIndex.tsx(10,17): error TS2339: Property 'props' does not exist on type 'AppIndex'.
src/app/AppIndex.tsx(11,10): error TS2604: JSX element type 'Footer' does not have any construct or call signatures.
src/app/Footer.tsx(2,10): error TS2305: Module ''react-router'' has no exported member 'Link'.
src/app/Footer.tsx(4,37): error TS2314: Generic type 'Component<P, S>' requires 2 type argument(s).
src/app/Header.tsx(2,10): error TS2305: Module ''react-router'' has no exported member 'Link'.
src/app/Header.tsx(4,37): error TS2314: Generic type 'Component<P, S>' requires 2 type argument(s).
src/app/NotFound.tsx(3,39): error TS2314: Generic type 'Component<P, S>' requires 2 type argument(s).
src/index.tsx(1,8): error TS1192: Module '"c:/test/13656/webpack-with-react/node_modules/@types/react/index"' has no default export.
....
|
Weird. I don't see the issue anymore. Initially, the first set of |
Add 'dist' directory to remove some TS compilation error. See microsoft/TypeScript#13656 for more info
With the new version of Typescript, not sure how recent, if you define a tsconfig but have no ts files to compile you get a
error.
Actually:
As I said, this is a fairly recent change and looking at the config options, I do not see a way to disable this requirement. My organization is building a large (30+ web and API projects) solution and instead of having each web have its own copy of the tsconfig, we prefer to have a single copy that gets injected into each of the web projects. However, not all of the projects have a need for custom JS so not all of them will have TS files... but now, all of our builds without a TS file fail! Why was this change made without allowing an option to disable this requirement? How do I work around this issue without having to reengineer our whole build process?!? These kinds of changes should not be made without considering how this will impact others!
The text was updated successfully, but these errors were encountered: