Skip to content

tsc watcher issue when running with non-pooling #27326

@ycabon

Description

@ycabon

TypeScript Version: 3.0.3

Running TSC in watch mode with the global variable TSC_NONPOLLING_WATCHER set to 1 triggers errors on the console.

Search Terms:

  • non pooling watcher
  • TSC_NONPOLLING_WATCHER

Actual behavior:

tsc prints the following error:

14:16:37 - Found 0 errors. Watching for file changes.
C:\inetpub\wwwroot\project\node_modules\typescript\lib\tsc.js:1146
    function toLowerCase(x) { return x.toLowerCase(); }
                                       ^

TypeError: Cannot read property 'toLowerCase' of undefined
    at toLowerCase (C:\inetpub\wwwroot\arcgis-js-api-4\node_modules\typescript\lib\tsc.js:1146:40)
    at FSWatcher.<anonymous> (C:\inetpub\wwwroot\arcgis-js-api-4\node_modules\typescript\lib\tsc.js:2338:68)
    at emitTwo (events.js:126:13)
    at FSWatcher.emit (events.js:214:7)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1364:12)

The error comes from an undefined fileName here, https://github.com/Microsoft/TypeScript/blob/b5639786bdddd2ba97a9c41feecddccb40d3b46c/src/compiler/sys.ts#L795-L810 that is passed to toCanonicalName() which maps to toLowerCase().

relativeFileName is null when the error occurs.

I'm running tsc on Windows in VSCode's terminal, tried with powershell and cmd, with same result.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions