Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Plugin doesn't output non-fatal errors. #43

Closed
krzksz opened this issue Apr 29, 2016 · 20 comments
Closed

Plugin doesn't output non-fatal errors. #43

krzksz opened this issue Apr 29, 2016 · 20 comments
Labels

Comments

@krzksz
Copy link

krzksz commented Apr 29, 2016

So right now plugin is able to forward any errors that break Typescript compilation but it doesn't output any other like types incompatibility etc. I just set up simple project with single input file and while tsc compiler properly reports this errors, compilation using rollup and this plugin stays silent. Is this the desired behavior?

I found this test repo: https://github.com/cetra3/rollup-ts-test. You can add something simple to app/main.ts file like:

var foo:Number = 'bar';

Rollup will display nothing while tsc main.ts will give:

main.ts(8,5): error TS2322: Type 'string' is not assignable to type 'Number'.
@dbrgn
Copy link

dbrgn commented May 10, 2016

I tried to add "noEmitOnError": true to tsconfig.json. With that, rollup seems to crash:

Debug Failure. False expression: Output generation failed

@ghost
Copy link

ghost commented Jun 18, 2016

Hi all!! Looks like this Rollup plugin repo is malfunction or not alive anymore? Lot of issues, and no fixes? yeah yeah! Open source! What to expect! I'm going to have me a beer no! Cheers bro! Love yeah all!!

@ghost
Copy link

ghost commented Jun 24, 2016

@Victorystick 2 months now. Are this issue going to be solved soon?

@dbrgn
Copy link

dbrgn commented Jun 24, 2016

@jonnyOwnTheWorld I'm not sure whether you're a troll or not, but please stop this attitude of entitlement when dealing with open source projects. If you want this to be fixed, either fix it yourself and provide a pull request or ask the developer whether you may pay him/her to fix it.

By being rude, you achieve the opposite. If I were the developer, comments like yours would create incentive to prioritize other issues over this one.

@yvbeek
Copy link

yvbeek commented Aug 9, 2016

Did a new version of typescript break this functionality?
Or did this never work?

If would love to help out, but I'm not sure where to start.

@TrySound
Copy link
Member

TrySound commented Aug 9, 2016

@Zyphrax This plugin now only for transpilation. Type checking should be done separately.

@ghost
Copy link

ghost commented Aug 9, 2016

@TrySound Can you elaborate Type checking should be done separately? The main point with TypeScript is the type defination. And the compiler will automatically refuse to transpile if there are any errors. That's the main reason why people are using TypeScript.

With current version of Rollup TypeScript the errors are swallowed, and no type checking. The code get compiled even if there are errors!!! Not very handy!

If you look at other TypeScript plugins - e.g. Webpack or Gulp - the type checking is not done separately. It works as ecpected.

So how is this going to be solved with Rollup? The main solution for people who want to bundle with Rollup today and also use TypeScript, is to skip using this plugin and use the TSC to transpile the code first to ES6 and then bundle with Rollup. Extra disk write etc when it all could have been done in memory.

@TrySound
Copy link
Member

TrySound commented Aug 9, 2016

There are errors of parsing which can be present here and errors with types, which should have state of all files. It's like flow types. Type checker is one project with own kitchen, strippers are different. The problem is ts API. It should expose some information for caching. The only way to make incremental build is some language service. But it's not what we need, if it can't be written on disk. If I miss something please correct me.

@ghost
Copy link

ghost commented Aug 9, 2016

Maybe this could help? https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API
Also take a look at the Gulp TS plugin.

@TrySound
Copy link
Member

TrySound commented Aug 9, 2016

I saw it. Nope.

@TrySound
Copy link
Member

TrySound commented Aug 9, 2016

I will take a look at gulp plugin soon.

@ghost
Copy link

ghost commented Aug 9, 2016

@yvbeek
Copy link

yvbeek commented Aug 10, 2016

@TrySound thank you!

I'm trying to tie all the tools together, but the lack of output makes it really hard to diagnose any configuration issues as well. "Debug Failure. False expression: Output generation failed" is not that useful.

@ghost
Copy link

ghost commented Aug 11, 2016

@TrySound Did you look at gulp, and can we expect a solution on this issue?

@TrySound
Copy link
Member

Not yet. Need to publish last changes first. I need at least be able to transpile modules.

@ghost
Copy link

ghost commented Aug 16, 2016

@TrySound This bug has to be related to something inside the Rollup core. I managed to create a similar plugin for my own code, and only sent in the raw file data so it more or less worked the same way as TSC in the CLI.

A few break points with help of a eventEmitter stopped the code on any error during the transpilation.

@Ventajou
Copy link

Any update on this? It would be nice if TS errors could break CI builds without the overhead of running tsc first

@olivoil
Copy link

olivoil commented Apr 6, 2017

Hi! Does anyone have any clue on how to fix this? And if not, what is the approach that has worked best for you guys instead of this plugin?

@ezolenko
Copy link

ezolenko commented Apr 6, 2017

From my experience, I recommend writing your own :)

https://github.com/ezolenko/rollup-plugin-typescript2

@PaulBGD
Copy link
Collaborator

PaulBGD commented May 23, 2017

Closing issues that I've integrated into #91, will be merged into master soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants