Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

at-loader does not display checking errors #347

Open
johnbendi opened this issue Jan 11, 2017 · 34 comments
Open

at-loader does not display checking errors #347

johnbendi opened this issue Jan 11, 2017 · 34 comments

Comments

@johnbendi
Copy link

at-loader just leaves me with the following ambiguous error message:

[at-loader] Checking started in a separate process...

[at-loader] Checking finished with 5 errors
@AlexGalays
Copy link

AlexGalays commented Jan 12, 2017

I have the same issue with the latest version (3.0.0-beta.18) and webpack 2.2 rc3.

It always works the very first time, and sometimes it continues to work for a while but once it get stuck with the above message, I have to restart the watch. That's a big blocker.

@kristaps
Copy link

kristaps commented Jan 18, 2017

May be something different but when using watch I get a listing of all errors on the first compile, and only the "finished with x errors" summary on subsequent compiles.

@kristaps
Copy link

Versions: [email protected], [email protected], anything else that could help?

@tony-gutierrez
Copy link

+1, this is killing me.

@AlexGalays
Copy link

AlexGalays commented Jan 25, 2017

ts-loader works just fine with webpack 2 by the way, if you're stuck.

@coffius
Copy link

coffius commented Jan 28, 2017

+1

@ghost
Copy link

ghost commented Jan 30, 2017

I can see error detail in browser console.

@erikstoff
Copy link

+1

@s-panferov
Copy link
Owner

Hello everybody, could you please try the latest version? Or could someone please create a repo? I have output tests and everything seems to work fine.

@jvanbruegge
Copy link

For me it happens only with the webpack 2 node API, with the cli everything works fine

@s-panferov
Copy link
Owner

If you run webpack by hand, the loader acts in non-watch mode and simply pushes all the errors to webpack.

https://github.com/s-panferov/awesome-typescript-loader/blob/master/src/instance.ts#L380-L384

You should expect to see the errors in webpack stats.

@dannypule
Copy link

Getting same issue "[at-loader] Checking finished with 12 errors". Doesn't show a list of errors in the command line. Only shows me what the errors are when I run. In my case, certain dependencies hadn't been installed (angular 2 cookie and redux) because I had done this before updating my angular starter applications package.json from it's original repo.

In other words: run your app on localhost and check whats in the console. Might give some clues.

@samal-rasmussen
Copy link

I had transpileOnly: true in my at-loader options. Changed it back to false, and got the errors back.

@davidmoshal
Copy link

+1

@davidmoshal
Copy link

same problem: at-loader: 3.0.8, webpack 2.2.1
updated to: 3.12 / 2.3.2 and problem persists.
ts-loader has same problem.
in both cases errors are reported to browser console, but not terminal.

@dennisat
Copy link

dennisat commented May 7, 2017

same problem: at-loader: 3.1.3 webpack 2.4.1
at least when I run tsc -watch I got the errors

@ythecombinator
Copy link

Still the same problem here 😢

Tried setting transpileOnly to false–as suggested by @samal84–but still no changes.

Using: at-loader: 3.1.3 and webpack 2.4.1

@ilyes-garifullin
Copy link

I have faced with the same issue and I made a temporary solution:

  1. go to node_modules/awesome-typescript-loader/dist/checker

  2. open runtime.js file

  3. find statement
    if (allDiagnostics.length) { console.error(colors.red("\n[" + instanceName + "] Checking finished with " + allDiagnostics.length + " errors")); }

  4. add allDiagnostics.map(function(err) { console.error(colors.red(err.messageText)); }) right after console.error call inside if (allDiagnostics.length) statement

I will be glad if this help to someone else.

@Blackbaud-SteveBrush
Copy link

@ilyes-garifullin I wonder if your fix merits a PR? Thanks for the tip!

@bsoulier
Copy link

bsoulier commented Jun 5, 2017

Just added the filename, makes it easier to find the error:
allDiagnostics.map(function (err) {console.error(colors.red(err.file.fileName + ':' + err.messageText)); });

@pisrael
Copy link

pisrael commented Jun 15, 2017

Same problem here. Not being able to see the errors with webpack --watch.

@davidm-public
Copy link

+1

@davidm-public
Copy link

davidm-public commented Jun 15, 2017

Thanks @bsoulier
This worked for me:

allDiagnostics.map( function (err) {
   console.error(colors.red(err.file.fileName + ':' + err.messageText)); 
});
"awesome-typescript-loader": "^3.1.2",
"typescript": "^2.2.2",
"webpack": "^2.4.1",

@pisrael
Copy link

pisrael commented Jul 17, 2017

At version 3.2.1 it changes a bit

"awesome-typescript-loader": "^3.2.1"

1. go to node_modules/awesome-typescript-loader/dist/instance.js

2. find statement

console.error(colors.red("\n[" + instanceName + "] Checking finished with " + diags.length + " errors"));

3. Add right below it (inside the same if)

diags.map( function (diag) {
     console.error(colors.red(diag.pretty)); 
})

@hdpinto
Copy link

hdpinto commented Sep 19, 2017

Is anything being done about this? I'm still having this issue and it's now September.

@arthens
Copy link

arthens commented Sep 21, 2017

I'm trying atl and ran into this problem too. I can always "fix" it by introducing a new error (e.g. removing an import). For some reason this causes the errors to start working again.

Initially I thought it simply didn't show the errors if they were the same or a subset of the previous compilation (which would explain why a introducing a new error fixes it), but after using it for a few days I'm not sure anymore...

@arthens
Copy link

arthens commented Sep 21, 2017

Ok I did a bit of investigation and realised it was a configuration problem, I'm going to post it in case anyone else did the same mistake.

tl;dr I was not using CheckerPlugin, which caused asyncError to be disabled. Adding the plugin fixed my problem.

Longer explanation:
atl requires CheckerPlugin to detect watch mode. If not in watch mode (or in watch mode but no plugin enabled) it will send the errors to webpack instead of printing them.

However, webpack will only print errors after bundling assets, but based on the change (and possibly your webpack configuration?) it might decide that no bundling is required, and skip printing errors. A few example of changes that would not trigger webpack:

  • changing a typescript method signature
  • adding/removing a type
  • new lines

This is because these changes are only relevant to TypeScript. Types are removed when the file is compiled to javascript. The compiled version will look unchanged to webpack... which will probably skip compilation and printing errors.

@winston01
Copy link

@arthens I added CheckerPlugin and set watch: true in webpack.config.js, but I still can't see the error details. Can you add a sample of your config file?

@arthens
Copy link

arthens commented Oct 18, 2017

@winston01 not sure how useful it's going to be, but here it is

@timc13
Copy link

timc13 commented Jun 19, 2018

This is still a problem - CheckerPlugin or not

@riq-dfaubion
Copy link

CheckerPlugin bandaided the problem for me as well.

@djyde
Copy link

djyde commented Sep 21, 2018

Same problem!

@djyde
Copy link

djyde commented Oct 18, 2018

almost two years. No one fix this problem?

@alienriver49
Copy link

I think the pull request, #437, is a bit old compared to the latest in the repository since this is now using webpack-log to log information. In order to fix this now you'll want to find this in the runtime.js file:

function processDiagnostics(_a) {

Go to the end of the function and add this line:

processedDiagnostics.forEach(function (diag) {
    log.info(diag.pretty);
});

I'll look into creating a new pull request for changes similar to this.

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

No branches or pull requests