ReferenceError : XMLHttpRequest is not defined when running my angular 6 universal app
问题 I have made a Angular 6 project with dependency Angularfire2 . I am using firestore and firebase storage. I have converted my app to angular universal and when i run server.js it says listening on localhost:4000 but as soon as i open the browser with localhost:4200 the terminal shows the following error: ReferenceError: XMLHttpRequest is not defined here is the snippet of the error 回答1: Install these dependencies: npm install --save-dev ws xmlhttprequest Then add this to your server.ts file