Skip to content
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

Errors list quickly in CLI but are cleared and do not interrupt webpack #71

Closed
speedy250 opened this issue Nov 21, 2017 · 2 comments
Closed

Comments

@speedy250
Copy link

I'm new to the FTCWPlugin, but I'm having a hard time believing that my experience is the norm.

Libraries
React: 15.4
Typescript: 2.4.2
ts-loader: 2.3.7
fork-ts-checker-notifier-webpack-plugin": "^0.2.0",
fork-ts-checker-webpack-plugin": "^0.2.8",
cache-loader: 1.2
thread-loader: 1.1.2

I'm using the thread-loader method which has cut my initial compile from ~4minutes to >1min, so keeping this setup is very desirable. When I compile via cli, here's what I see:

  1. Basic setup outputs, nothing crazy
  2. Massive (100+) outpouring of tslint or FTCWP errors (I'm not sure how to differentiate atm, and the 'massive' part is likely from moving from TS 2.2 to 2.4 and updating tslint/tslint-react)
  3. errors stop being listed, entire CLI is cleared, and I'm left with "Compiled Successfully! ..."

Updating files results in exact same output of steps 1, 2, 3, so no help there.

Couple questions I have:

  1. I like the ts-loader style of interrupting the website with whatever error has come up and forces you to fix it. How do I get that back? From reading the docs, I can see that using happyPackMode: True on ts-loader disables emitting problems to webpack - is there any recourse?
  2. Why are all these errors simply being dismissed and my build showing successful?
  3. If I put obviously incorrect code in my Typescript the build does not fail - what is happening here? For example <div asdf sytle="hi" and foo={''} /> still compiles, even though I'm sure the list of errors shows those attributes don't exist on

    So, does Typescript just compile a broken app and assume it's fine? Is it up to me every time to check with FTCWP that my build is correct, even though it has compiled correctly?

halp plz thx

@johnnyreilly
Copy link
Member

Do you want to try the async: false option? - this will break the build by passing errors from the plugin to webpack and is probably the behaviour you want. It's not the default for speed reasons.

@DorianGrey
Copy link
Contributor

The "Compiled Successfully! ..." message in conjunction with the react dependency points me to an ejected CRA project ... is that the case?
If so, you should follow @johnnyreilly 's suggestion to config the plugin to sync mode. The default CRA behavior is a hard clean (i.e. it skips your terminal's content) before and after the build, so any error listed in between will be kicked off. With ts-loader (and thus tsc) in transpileOnly mode, the build will at most break on malformed code that cannot be parsed properly.

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

No branches or pull requests

4 participants