Firebase-js-sdk: Error in IE9 and IE10. Cannot instantiate firebase-database.js - be sure to load firebase-app.js first

Created on 10 Aug 2017  路  8Comments  路  Source: firebase/firebase-js-sdk


Environment

  • Operating System version: Win 7
  • Firebase SDK version: firebasejs 4.2.0
  • Firebase Product: database

The problem

I'm getting this error below when loading our angular application in IE9 and IE10. It works fine on IE11.
Cannot instantiate firebase-database.js - be sure to load firebase-app.js first.

Steps to reproduce:

  1. $ ng new firebase-app
  2. $ cd firebase-app
  3. Modify src/polyfills.ts
  4. Uncomment all import under /* IE9, IE10 and IE11 requires all of the following polyfills */
  5. Uncomment import 'classlist.js';
  6. $ npm install --save classlist.js
  7. Modify src/index.html and add firebase links.
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>FirebaseApp</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <script src="https://www.gstatic.com/firebasejs/4.2.0/firebase-app.js"></script>
  <script src="https://www.gstatic.com/firebasejs/4.2.0/firebase-auth.js"></script>
  <script src="https://www.gstatic.com/firebasejs/4.2.0/firebase-database.js"></script>

</head>
<body>
  <app-root></app-root>
</body>
</html>
  1. $ ng serve
  2. Open http://localhost:4200 in ie9 or ie10 browser and in the console tab you'll see this error:
    Cannot instantiate firebase-database.js - be sure to load firebase-app.js first.
database

Most helpful comment

It isn't a Angular specific issue. Here is a very simple Fiddle which only includes Firebase 4.2.0:
https://jsfiddle.net/teq0nx3L/1/

On IE10 or IE9, this throws the error described in the op. 4.1.2 is the last working Firebase version.

Here is the reply we got from Firebase support regarding this:
Hi there,
Thanks for reaching out! I tested it out and I'm getting the same error. I'll reach out to the team about this and I'll let you know when I have more information.

Thanks,
Wiley

and the ticket number: 3-5880000018856

Environment: Windows 7, Windows 8
Browser: Internet Explorer 9 & Internet Explorer 10
Version: Firebase 4.2.0
Last Working Version: Firebase 4.1.2
Reproduction Fiddle: https://jsfiddle.net/teq0nx3L/1/
Steps: Go to the Fiddle above with IE10 or IE9. Open the console. Reload the page. Note how you always receive a "Cannot instantiate firebase-database.js - be sure to load firebase-app.js" error on each load.
Note: Firebase 4.3.0 does not resolve the issue.

All 8 comments

Same here

SCRIPT5022: Cannot instantiate firebase-database.js - be sure to load firebase-app.js first.
firebase.js, line 320 character 170977

me the same. It works in IE 11 but not in IE 10 and lower version.

SCRIPT5022: Cannot instantiate firebase-database.js - be sure to load firebase-app.js first. 
firebase.js, line 320 character 170977

Are all three of you using Angular? "Same here" is a fast reply, but not very useful for us. Including environment, version, and steps to repro (or a failing test unit) will help us isolate the cause and find a fix.

It isn't a Angular specific issue. Here is a very simple Fiddle which only includes Firebase 4.2.0:
https://jsfiddle.net/teq0nx3L/1/

On IE10 or IE9, this throws the error described in the op. 4.1.2 is the last working Firebase version.

Here is the reply we got from Firebase support regarding this:
Hi there,
Thanks for reaching out! I tested it out and I'm getting the same error. I'll reach out to the team about this and I'll let you know when I have more information.

Thanks,
Wiley

and the ticket number: 3-5880000018856

Environment: Windows 7, Windows 8
Browser: Internet Explorer 9 & Internet Explorer 10
Version: Firebase 4.2.0
Last Working Version: Firebase 4.1.2
Reproduction Fiddle: https://jsfiddle.net/teq0nx3L/1/
Steps: Go to the Fiddle above with IE10 or IE9. Open the console. Reload the page. Note how you always receive a "Cannot instantiate firebase-database.js - be sure to load firebase-app.js" error on each load.
Note: Firebase 4.3.0 does not resolve the issue.

Any news on a fix?

This is low priority given the affected browsers and small number of affected users. Given our current backlog, it seems realistic to expect that we will sunset IE 10 support before we get time to investigate a fix for this. Keep in mind that the limitation here is bandwidth, so if a low risk PR were submitted to resolve this, we may have time to review that and merge.

IE 9 is already unsupported. There's no planned date for sunsetting IE 10 at this time.

@lTyl thanks for your remark regarding 4.1.2. I downgraded to that version and it's working now for IE10.

I'm going to close this in favor of https://github.com/firebase/firebase-js-sdk/issues/157 which has more information on the issue.

Was this page helpful?
0 / 5 - 0 ratings