Firebase + Node.js
On iOS:
Where test.js is a very simply script to connect to Firebase:
var firebase = require("firebase/app");
require("firebase/auth");
var config = {
...
};
var app = firebase.initializeApp(config); // Works fine
firebase.auth().signInWithEmailAndPassword(…); // Throws error
The error thrown is
Error: The XMLHttpRequest compatibility library was not found.
What am I overlooking? Thanks.
I had the same issue by using Angularfire2 with Universal Server Side rendering. I've solved it by adding the xmlhttprequest
to my server.js
file.
Just like this:
npm install xmlhttprequest --save
and adding it like:
global.XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
or
global['XMLHttpRequest'] = require('xmlhttprequest').XMLHttpRequest;
Maybe it helps someone!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With