Firebase-js-sdk: Firebase Database (4.3.1) INTERNET ASSERT FAILED: Reference.ts has not been loaded.

Created on 8 Sep 2017  路  15Comments  路  Source: firebase/firebase-js-sdk


[REQUIRED] Describe your environment

  • Operating System version: Windows7/Windows10
  • Firebase SDK version: 4.3.1
  • Firebase Product: database (auth, database, storage, etc)

[REQUIRED] Describe the problem

When I load my Angular app with IE10, I see an error message:
Firebase Database (4.3.1) INTERNET ASSERT FAILED: Reference.ts has not been loaded.

Steps to reproduce:

It's very easy to reproduce. Just install fresh Angular project with firebase module.

$ ng new projectName
$ cd projectName
$ npm install firebase
... setup firebase ...
... setup polyfills for IE ...
$ ng serve
... browser with IE11 and Emulate IE10 and you will see error.

When I use IE11 in Windows 10 emulating IE10, I see this error.
When I use IE10 in Windows 7 (on Virtual Box), I see this error.

image

database

Most helpful comment

I can confirm this issue when using an android emulator with nativescript. I am building an app and when using firebase to register a new user it throws this error. Has anyone found a solution yet?

All 15 comments

I was hoping the latest release (4.3.1) would fix this, but it still exists. I have them same setup and steps to reproduce.

After digging through the source, I found that commenting out this line works, but I am unsure of what the consequences are, but it may help you get to other errors that you can begin fixing. https://github.com/firebase/firebase-js-sdk/blob/bc1f67c448804a28fa64e91611ea60398890bcaa/src/database/api/Query.ts#L66

After doing some digging it looks like IE10 is calling the Query.__referenceConstructor.get() before calling Query.__referenceConstructor.set(val) which is causing the assert to fail because the field has not been defined before it is requested. This does not appear to be happening in Chrome. Not sure if this is helpful, but this bug is affecting me as well.

Could this be because of a difference in the way that IE loads prototype constructors rather than how Chrome handles them?

By adding console.log() calls in various spots in the compiled javascript I was able to track down this discrepancy. The console logs are in Query.js starting at line 58:

var Query = function () {
    console.log('Query()', this);
    function Query(repo, path, queryParams_, orderByCalled_) {
        this.repo = repo;
        this.path = path;
        this.queryParams_ = queryParams_;
        this.orderByCalled_ = orderByCalled_;
    }
    Object.defineProperty(Query, "__referenceConstructor", {
        get: function get() {
            if (typeof __referenceConstructor !== 'function') {
                console.log('Query.__referenceConstructor.get() not found');
            }
            //(0, _assert.assert)(__referenceConstructor, 'Reference.ts has not been loaded');
            return __referenceConstructor;
        },
        set: function set(val) {
            console.log('Query.__referenceConstructor.set', val);
            __referenceConstructor = val;
        },
        enumerable: true,
        configurable: true
    });

and Reference.js line 317:

 console.log('Setting __referenceConstructor in Reference.js');
_Query.Query.__referenceConstructor = Reference;
_SyncPoint.SyncPoint.__referenceConstructor = Reference;

ie-v-chrome

Confirm this issue started from version 4.1.4 after trying several times.

Since #125 was closed in favor of this, is this issue inheriting the "won't fix" opinion kato posted?

As @katowulf mentioned the limitation here is bandwidth. I'd love for someone to take a look at this and submit a fix but given that the impact is only for IE 10, this is low priority for now.

I can confirm this issue when using an android emulator with nativescript. I am building an app and when using firebase to register a new user it throws this error. Has anyone found a solution yet?

just ran into this using IOS Simulator?

@aaronksaunders, I have the issue with Android Simulator as stated above. It looks as though google is putting this issue on the back burner due to the narrowness of the scope (since it only effects I.E. and simulators).

I have just decided to move on, leaving FireBase behind, and use MongoDB instead.

issue still present in Firebase 4.6.2 under IE9 and IE10.

Under IE10:

Firebase Database (${JSCORE_VERSION}) INTERNAL ASSERT FAILED: Reference.ts has not been loaded
File "../node_modules/@firebase/util/dist/cjs/src/assert.js" line 26 col 1 in [anonymous]
throw exports.assertionError(message);

The issue still exists in Firebase 4.9.0 under IE 10.
I have to downgrade the version to 4.1.3 according to this.

@schmitzt3 's way also works.

same error under IE11 (_11.0.9600.18894_), firebase 5.6.0, Windows 8.1
````
Firebase Database (${JSCORE_VERSION}) INTERNAL ASSERT FAILED: Reference.ts has not been loaded

still the same error in firebase 6.0.2 on IE10 and IE9...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

suparnavg picture suparnavg  路  3Comments

damonmaria picture damonmaria  路  4Comments

colinskow picture colinskow  路  4Comments

hvonralvert picture hvonralvert  路  3Comments

Kosai106 picture Kosai106  路  3Comments