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

When "composite": true specified in tsconfig.json, extras.diagnostics becomes an empty array #171

Open
pucelle opened this issue Oct 23, 2024 · 1 comment

Comments

@pucelle
Copy link

pucelle commented Oct 23, 2024

I don't know if this is an issue.
I can get all the extras.diagnostics after changes composite to false.

In addition, I noticed when work with ts-loader, extras.diagnostics becomes empty too, while using tspc command is OK.

I also find when work with tspc -w, same issue happens.

@pucelle
Copy link
Author

pucelle commented Nov 10, 2024

I have found the reason of this issue:

The patch of watch.ts, function

function emitFilesAndReportErrors<T extends BuilderProgram>(program: Program | T, ...)

When compile with tspc directly, program parameter is Program type, but when compile with tspc -w, program parameter is BuilderProgram type.

I can confirm to fix this issue by patching with tsp.diagnosticMap.set(program.getProgram ? program.getProgram() : program, allDiagnostics), but since I'm not familiar with typescript source codes, I would not give a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant