Skip to content

Bug: watch mode does not work since 2.8.0-dev.20180314 #22668

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

Closed
taoqf opened this issue Mar 17, 2018 · 13 comments
Closed

Bug: watch mode does not work since 2.8.0-dev.20180314 #22668

taoqf opened this issue Mar 17, 2018 · 13 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@taoqf
Copy link

taoqf commented Mar 17, 2018

TypeScript Version: 2.8.0-dev.20180316

Search Terms:

Code

tsc -w

Expected behavior:

Starting compilation in watch mode...
Compilation complete. Watching for file changes.

Actual behavior:
Starting compilation in watch mode...

and no files generated

Playground Link:

Related Issues:

@taoqf
Copy link
Author

taoqf commented Mar 17, 2018

I tried 2.7.2, it works fine.

@taoqf
Copy link
Author

taoqf commented Mar 17, 2018

Am I missing any options in v2.8 ?

@DanielRosenwasser DanielRosenwasser added Needs More Info The issue still hasn't been fully clarified and removed Needs More Info The issue still hasn't been fully clarified labels Mar 17, 2018
@taoqf
Copy link
Author

taoqf commented Mar 19, 2018

Besides, CPU keep highly occupied.
2.8.0-dev.20180318 has the same issue, too.

@taoqf
Copy link
Author

taoqf commented Mar 19, 2018

2.8.0-dev.20180308 works fine.
this issue start from 2.8.0-dev.20180314.

@taoqf taoqf changed the title do not generate js in watch mode watch mode does not work since 2.8.0-dev.20180314 Mar 19, 2018
@taoqf taoqf changed the title watch mode does not work since 2.8.0-dev.20180314 Bug: watch mode does not work since 2.8.0-dev.20180314 Mar 20, 2018
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript High Priority labels Mar 20, 2018
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 2.8.1 milestone Mar 20, 2018
@DanielRosenwasser
Copy link
Member

Do you have a sample project we could take a look at at all that exhibits this behavior?

@sheetalkamat @RyanCavanaugh perhaps issues you're looking into might be be related here.

@DanielRosenwasser DanielRosenwasser added the Needs More Info The issue still hasn't been fully clarified label Mar 20, 2018
@taoqf
Copy link
Author

taoqf commented Mar 20, 2018

https://github.com/taoqf/sample
this will do.
it works fine if I remove dependence webpack-stream, or do not import symbols from another lib.
It doesn't matter if not-exist exist or not.

@sheetalkamat
Copy link
Member

@taoqf What are the exact steps you are following.
Here is what I did with your sample project

c:\github\sample>node c:\TypeScript\built\local\tsc.js -w --preserveWatchOutput
[09:24:12] Starting compilation in watch mode...


src/sample.ts:1:1 - error TS6133: 'fun' is declared but its value is never read.

1 import { fun } from 'not-exist';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/sample.ts:1:21 - error TS2307: Cannot find module 'not-exist'.

1 import { fun } from 'not-exist';
                      ~~~~~~~~~~~


src/sample.ts:3:7 - error TS6133: 'no' is declared but its value is never read.

3 const no = 'fd-w000001';
        ~~


[09:24:13] Compilation complete. Watching for file changes.

Ran ````npm install``` after this from another command prompt. There is no additional output since there is no change in program with those installs..

Changed no to no2 and I see new errors being presented as:

[09:26:02] File change detected. Starting incremental compilation...


src/sample.ts:1:1 - error TS6133: 'fun' is declared but its value is never read.

1 import { fun } from 'not-exist';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/sample.ts:1:21 - error TS2307: Cannot find module 'not-exist'.

1 import { fun } from 'not-exist';
                      ~~~~~~~~~~~


src/sample.ts:3:7 - error TS6133: 'no2' is declared but its value is never read.

3 const no2 = 'fd-w000001';
        ~~~


[09:26:02] Compilation complete. Watching for file changes.

New outputs are also generated correctly and don't see any impact on cpu cycles.

Is there something I am missing.

@taoqf
Copy link
Author

taoqf commented Mar 23, 2018

It like is the same issue like microsoft/vscode#45952 (comment)
try this.

npm i -g cnpm
cnpm i
./node_modules/.bin/tsc -w --preserveWatchOutput

If I install node_modules use npm i, it will be ok.

see cnpm

@sheetalkamat
Copy link
Member

Followed your steps and yet dont see issue with cpu or reporting error or file generation?

c:\github\sample>npm i -g cnpm
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
C:\Users\shkamat\AppData\Roaming\npm\cnpm -> C:\Users\shkamat\AppData\Roaming\npm\node_modules\cnpm\bin\cnpm
+ [email protected]
added 778 packages in 38.879s

c:\github\sample>cnpm i
/ [1/2] Installing static-extend@^0.1.1platform unsupported [email protected][email protected][email protected][email protected] › fsevents@^1.1.2 Package require os(darwin) not compatible with your platform(win32)
[fsevents@^1.1.2] optional install error: Package require os(darwin) not compatible with your platform(win32)
√ Installed 2 packages
√ Linked 294 latest versions
√ Run 1 scripts
Recently updated (since 2018-03-16): 7 packages (detail see file c:\github\sample\node_modules\.recently_updates.txt)
√ All packages installed (327 packages installed from npm registry, used 27s, speed 572.18kB/s, json 296(4.01MB), tarball 11.21MB)

c:\github\sample>node_modules\.bin\tsc --w --preserveWatchOutput
[10:38:07] Starting compilation in watch mode...


======== Resolving module 'not-exist' from 'c:/github/sample/src/sample.ts'. ========
Explicitly specified module resolution kind: 'NodeJs'.
Loading module 'not-exist' from 'node_modules' folder, target file type 'TypeScript'.
Directory 'c:/github/sample/src/node_modules' does not exist, skipping all lookups in it.
File 'c:/github/sample/node_modules/not-exist.ts' does not exist.
File 'c:/github/sample/node_modules/not-exist.tsx' does not exist.
File 'c:/github/sample/node_modules/not-exist.d.ts' does not exist.
Directory 'c:/github/sample/node_modules/@types' does not exist, skipping all lookups in it.
Directory 'c:/github/node_modules' does not exist, skipping all lookups in it.
Directory 'c:/node_modules' does not exist, skipping all lookups in it.
Loading module 'not-exist' from 'node_modules' folder, target file type 'JavaScript'.
Directory 'c:/github/sample/src/node_modules' does not exist, skipping all lookups in it.
File 'c:/github/sample/node_modules/not-exist.js' does not exist.
File 'c:/github/sample/node_modules/not-exist.jsx' does not exist.
Directory 'c:/github/node_modules' does not exist, skipping all lookups in it.
Directory 'c:/node_modules' does not exist, skipping all lookups in it.
======== Module name 'not-exist' was not resolved. ========
src/sample.ts:1:1 - error TS6133: 'fun' is declared but its value is never read.

1 import { fun } from 'not-exist';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/sample.ts:1:21 - error TS2307: Cannot find module 'not-exist'.

1 import { fun } from 'not-exist';
                      ~~~~~~~~~~~


src/sample.ts:3:7 - error TS6133: 'no' is declared but its value is never read.

3 const no = 'fd-w000001';
        ~~


[10:38:08] Compilation complete. Watching for file changes.


[10:39:26] File change detected. Starting incremental compilation...


src/sample.ts:1:1 - error TS6133: 'fun2' is declared but its value is never read.

1 import { fun2 } from 'not-exist';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/sample.ts:1:22 - error TS2307: Cannot find module 'not-exist'.

1 import { fun2 } from 'not-exist';
                       ~~~~~~~~~~~


src/sample.ts:3:7 - error TS6133: 'no' is declared but its value is never read.

3 const no = 'fd-w000001';
        ~~


[10:39:26] Compilation complete. Watching for file changes.

@taoqf
Copy link
Author

taoqf commented Mar 24, 2018

Could you please try Linux? I use this on Debian, they have different behavior.

@sheetalkamat
Copy link
Member

sheetalkamat commented Mar 28, 2018

I was able to get this to repro on linux and have a repro. I have rough idea where this is coming from but working on getting exact repro so i can fix it correctly. Thanks.
Note: The issue is with linux where in node's watch directory doesnt support the recursive directory watcher and the new implentation watches child directories but is exploding when doing cnpm i since it creates bunch of sym links resulting in i suspect circularity which we arent handling well.

@taoqf
Copy link
Author

taoqf commented Mar 29, 2018

Will this be fixed in next published version?

@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Needs More Info The issue still hasn't been fully clarified labels Mar 29, 2018
@taoqf
Copy link
Author

taoqf commented Mar 31, 2018

Thanks, I've tried version 2.9.0-dev.20180330, it's OK now.

@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority
Projects
None yet
Development

No branches or pull requests

5 participants