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

tsc --watch regression in typescript@next: not detecting .tsx file changes (only .ts) #6511

Closed
chbrown opened this issue Jan 16, 2016 · 6 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@chbrown
Copy link

chbrown commented Jan 16, 2016

I'm using typescript@next (specifically, 1.8.0-dev.20160115) instead of typescript@1.7.5 because I want stateless functional component support in my React code. Running tsc --watch in my root project directory is working great for .ts files:

9:08:58 PM - File change detected. Starting incremental compilation...
9:09:00 PM - Compilation complete. Watching for file changes.

But it's not even flinching when a .tsx file changes. I downgraded to 1.7.5, and now (with no other changes) running tsc --watch recognizes changes to both .ts and .tsx files (despite complaining a bit about my JSX not evaluating to proper Elements or whatever).

I'm using a tsconfig.json with:

"compilerOptions": {
  "jsx": "react",
  "module": "commonjs",
  "moduleResolution": "node",
  "target": "ES6"
},

And a bunch of files added by hand, including both .ts and .tsx files in the root directory.

Like I said, 1.7.5 works just fine, so it's not something weird with my editor. Has .tsx been deprecated? (Which would be awesome— I'm all for deprecating .tsx and compiling all .ts files as if they were .tsx if compilerOptions.jsx !== undefined.)

@chbrown
Copy link
Author

chbrown commented Jan 16, 2016

Update: just switched to working on a different project that didn't have the problem, and found it was running typescript@1.8.0-dev.20160108. So the regression happened sometime in the last week.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 16, 2016

Looks like a bug. @zhengbli this looks related to your watch fix. Can you take a look?

@mhegazy mhegazy added Bug A bug in TypeScript High Priority labels Jan 16, 2016
@mhegazy mhegazy assigned mhegazy and zhengbli and unassigned mhegazy Jan 16, 2016
@mhegazy mhegazy added this to the TypeScript 1.8 milestone Jan 16, 2016
@zhengbli
Copy link
Contributor

This should be the same problem that #6509 was fixing. I tested using the one from master and .tsx files work fine now.

@chbrown can you try the tsc.js I created at https://gist.github.com/zhengbli/0e63584b3daf3b521671 ?

@zhengbli
Copy link
Contributor

@chbrown the latest nightly should contain the fix. Can you give it a try? Thanks

@chbrown
Copy link
Author

chbrown commented Jan 16, 2016

Awesome! Just updated to typescript@1.8.0-dev.20160116 and it's recognizing .tsx changes again. Thanks @zhengbli (and @mhegazy for the diagnosis & triage)!

@mhegazy
Copy link
Contributor

mhegazy commented Jan 16, 2016

Thanks @chbrown!

@mhegazy mhegazy closed this as completed Jan 16, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jan 16, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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

3 participants