Open renatoaraujoc opened 1 year ago
Hello,
Fixed it with:
import XMLHttpRequest from 'xhr2';
(global as any).XMLHttpRequest = XMLHttpRequest;
in server.ts
.
I'm leaving this opened so you guys can maybe provide 'xhr2' as dependency, detect if XMLHttpRequest is present, if not, use this library.
It's up to you :)
🐞 Bug report
Description
Dispatching an error on server-side of Angular will error with XMLHttpRequest not defined.
Reproduction
No need to reproduce this, afaik XMLHttpRequest is not a defined in node environments.
Expected behavior
The library has to provide some sort of http-request api (to at least inform in the readme that we're supposed to provide it on the global window object) to report errors on server-side if its supposed to. Or completely ignore server-side errors and let the browser handle those as they implement the XMLHttpRequest object.
Versions
If needed:
Additional context
This is my server window object (necessary for lots of stuff to work): This is the error: