jsdom / webidl2js

Auto-generate JS class structures for Web IDL specifications
MIT License
79 stars 30 forks source link

Avoid "TypeError: Cannot convert undefined or null to object" in Angular Universal #255

Closed vkarpov15 closed 2 years ago

vkarpov15 commented 2 years ago

Sorry for the somewhat odd PR, but this issue is making the MongoDB Node driver and Mongoose fail in Angular Universal. Angular Universal does some strange transpiling that breaks how this lib is getting AsyncIteratorPrototype.

I tracked this down from https://github.com/Automattic/mongoose/issues/11155, https://github.com/angular/angular-cli/issues/21735, and opened a PR to work around this issue in Angular here: https://github.com/angular/angular-cli/pull/22550.

domenic commented 2 years ago

Sounds like a bug in their transpiler; this is not the right place to change.

vkarpov15 commented 2 years ago

Angular Universal team says that their transpiler is "correct" :( https://github.com/angular/angular-cli/issues/21735#issuecomment-915974013 Whether it actually is, is open to debate.

I think this PR is sufficiently low risk and unobtrusive to merge and unblock users. Can you please reconsider?

domenic commented 2 years ago

No, sorry, this is valid code and we won't change it because some tooling is doing something strange with it.