Skip to content

MaxListenersExceededWarning when using tsc -b -w with more than 10 projects #28690

@panjiesw

Description

@panjiesw

TypeScript Version: 3.2.0-rc

Search Terms:

  • MaxListenersExceededWarning
  • node:12372
  • build mode
  • watch
  • project reference

Code

When using Project Reference to more than 10 TypeScript projects and watching it for changes, node complains with MaxListenersExceededWarning. According to Node EventEmitter API, by default, a maximum of 10 listeners can be registered for any single event.

root tsconfig.json

{
  "files": [],
  "include": [],
  "references": [
    { "path": "pkg1" },
    { "path": "pkg2" },
    { "path": "pkg3" },
    { "path": "pkg4" },
    { "path": "pkg5" },
    { "path": "pkg6" },
    { "path": "pkg7" },
    { "path": "pkg8" },
    { "path": "pkg9" },
    { "path": "pkg10" },
    { "path": "pkg11" },
    { "path": "pkg12" },
  ]
}

Expected behavior:

Watch for changes and compiles without MaxListenersExceededWarning?

Actual behavior:

Code compiles fine if there is any changes, but there is MaxListenersExceededWarning

Related Issues:

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions