-
Notifications
You must be signed in to change notification settings - Fork 3k
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
TypeScript build failing in Node.js-only environment #1561
Comments
Adding "dom" to the compilerOptions lib array also fixes this issue.
|
Yes, I literally said in the issue that making Node.js only environment (which means not having DOM) is what causes this. So adding "dom" is not a solution, as it makes TS think the code is to run in a browser, not in Node.js. |
I could indeed reproduce the issue, let me check. |
Describe the bug
When building project using this as dependency using typescript with following option (no DOM library):
The project fails to build with following errors:
The same problem also affects engine.io, as seen.
Context
Triaged this issue to version 4.5.0, likely following commit: b862924
The error is because in node-only environment no
CloseEvent
norXMLHttpRequest
is defined.Fix suggestion
Similar issues in the past in typings have been fixed by adding following comment to the typings file:
Temporary workaround for anyone else facing this issue is adding following to TS config:
The text was updated successfully, but these errors were encountered: