-
-
Notifications
You must be signed in to change notification settings - Fork 433
Incorrect file list maintenance causes compiler error in particular cases #71
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
Thanks for the detailed report! I think you're probably right about not using getScriptSnapshot for the moduleResolutionHost. It was done that way because that's how TS does it automatically if you don't override I'm not sure what you meant by ts-loader not showing error messages from |
I see. But it's invoked only when compiler is created. In my case the first file compiled successfully, but 2nd file compilation fails (actually, file list was wrong on this stage, it contained json files). As result error messages says only:
After I have changed If it's needed I can create minimal reproducible example for this case. |
I don't think it's needed (yet). If I can't reproduce I'll let you know. What version of TypeScript are you using? |
1.6.2 |
I can confirm that proposed solution fixes the
|
I can't duplicate this after all :( I'm probably missing a setting somewhere. Could you provide a minimal example, including tsconfig.json and ideally webpack.config.js? |
I put my attempt at duplicating this in #75 in case it helps. I basically took the existing I verified that |
@jbrantly I emailed project sample to your public email. |
Ah-ha! You need |
Very cool @jbrantly, kudos for figuring this out! Thank you. |
Good to know that it has been fixed! |
In a day or two, probably. There are a couple other issues I'd like to get into the same release, and the PR still needs signing off. |
This was published in v0.5.6. Also, thanks @oryol and @alexgorbatchev for reporting this and helping debug/fix it, and apologies for the delay in getting it out. |
Fantastic, thank you so much! |
Prerequisites:
The flow which causes to error:
As a temporary fix (obiously, it's better to decouple module resolution host from the service host, it's just a workaround) I fixed ts-loader/index.js (directly in the my node_modules) using following code in the getScriptFileNames:
It causes that json files are not returned for TypeScript input but still are saved in the files array (maybe it's ok to cache package.json in this array, I'm not sure actually).
Also I suggest to add getCompilerOptionsDiagnostics to error list in some way. Because it's very hard to understand what is causing error in some cases.
The text was updated successfully, but these errors were encountered: