-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Watch API caching stale errors and not supporting lib
compiler option
#21325
Comments
This should be fixed by TypeStrong/ts-loader#715 |
Excellent work @sheetalkamat - thanks so much! I'll take a look at this tonight and report back |
Both the issues reported here are resolved - thanks so much! I've released a new version of ts-loader this morning that includes the fixes. I'll keep testing with more complex projects and report back if any other issues occur. https://github.com/TypeStrong/ts-loader/releases/tag/v3.3.1 |
TypeScript Version: 2.7.0-dev.20180120
Search Terms:
watch API
Code
See this illustration repo: https://github.com/johnnyreilly/typescript-ts-loader-watch-api-illustration
Expected behavior:
lib
compiler optionActual behavior:
lib
compiler optionRelated Issues:
Taken from the illustration repo:
New Watch API issues illustration
With TypeScript 2.7 support for the API is being exposed. This wonderful PR by @sheetalkamat to ts-loader added support for the API to ts-loader.
Naturally I'm super-excited about this! We pushed out v3.3.0 of ts-loader including support for the new watch API (which is available in the night builds).
Alas, the watch API functionality doesn't seem to be working as expected. It's unclear whether the problem is with the watch API or with the implementation in ts-loader. I found and fixed a suspected minor issue with the ts-loader watch API support. However everything else looks correct as best I can judge.
There's 2 issues I've spotted:
lib.dom.d.ts
etc) - if you uselib
in yourtsconfig.json
there are problems.I'm wondering if this is actually a problem with the watch API itself.
Here is a simple repro of the issues I've seen.
Not detecting file changes
yarn install
yarn start
(to usewebpack-dev-server
) oryarn watch
(to usewebpack --watch
)render.ts
(the error) and save the fileIf you amend the
webpack.config.js
to setexperimentalWatchApi: false
and repeat steps 3-6 then you will see that behaviour is as desired. But this is without using the new watch API.Usage of
lib
intsconfig.json
does not workrender.ts
(the error) and save the filelib
section in yourtsconfig.json
so it looks like this:yarn watch
The text was updated successfully, but these errors were encountered: