0

After solving my previous problem. I got an error as picture below provided.

enter image description here

I tried this Link but unfortunately it didn't work for me.

enter image description here

Initialize the firebase enter image description here

This is how I use it enter image description here

KiRa
  • 924
  • 3
  • 17
  • 42
  • Have you installed ```xmlhttprequest``` yet? – Kien Nguyen Jan 18 '21 at 02:34
  • @KienNguyen yes I have seen some link that suggest to install it. I tried it but still the same – KiRa Jan 18 '21 at 02:38
  • Why can't you use like `xhr: XMLHttpRequest = new XMLHttpRequest();` – Kshitij Jan 22 '21 at 14:55
  • @Kshitij I'm not using this `XMLHttpRequest `. I think it cause a problem in firebase?. No idea. – KiRa Jan 23 '21 at 13:23
  • Where's Firebase in your sample code though? – Slbox Jan 23 '21 at 22:31
  • I can't really tell what you're trying to do with XMLHttpRequest based on the code that you shared, but if you're trying to make a network request from the NodeJS side, using an npm library like "request" or "node-fetch" might be a better route to go. If you're trying to make the request from your angular app, then you shouldn't need to import XMLHttpRequest on the NodeJS side of the app, you should just have access to it as a normal javascript API from the angular client code. More code and explanation would help. – Joshua Terrill Jan 25 '21 at 00:38
  • possible duplicate of https://stackoverflow.com/questions/32604460/xmlhttprequest-module-not-defined-found – Hamid Jan 25 '21 at 01:08

1 Answers1

0

Your issue is probably that you're importing the version meant for a browser environment into a Node environment, but the code you've included is insufficient for us to be able to do anything but guess based on our own experiences.

Slbox
  • 10,957
  • 15
  • 54
  • 106
  • Sorry, because I'm still studying angular and new to this. I edited my question I hope it helps to understand my problem. – KiRa Jan 25 '21 at 01:20
  • What if you comment out all mentions of Firebase? Do you still get that error? – Slbox Jan 25 '21 at 23:25