Error in IE11, sometimes app won't boot up

Hi Guys,

since a few weeks our automated tests (selenium browserstack interaction tests), are getting white screens in IE11, already at the login of our ember application.

the error is : [{"message":"Exception thrown and not caught","source":"https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js","lineno":19832,"colno":9,"error":{"stack":"TypeError: Can't call method on null\n at module.exports (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:1062:24)\n at module.exports (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:2595:3)\n at keys (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:4509:5)\n at initialize (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:129169:5)\n at Anonymous function (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:20914:9)\n at Vertices.prototype.each (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:37090:17)\n at Vertices.prototype.walk (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:37019:13)\n at DAG.prototype.each (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:36964:13)\n at DAG.prototype.topsort (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:36970:13)\n at _runInitializer (https://regressietest.bluedolphin-tst.valueblue.nl/assets/vendor-a83cc45fd7a1bc030160eff353a5a4bd.js:20928:7)"}}]

and checked that line and it’s at:

    if (this.autoboot) {
      var instance = void 0;

      if (this._globalsMode) {
        // If we already have the __deprecatedInstance__ lying around, boot it to
        // avoid unnecessary work
        instance = this.__deprecatedInstance__;
      } else {
        // Otherwise, build an instance and boot it. This is currently unreachable,
        // because we forced _globalsMode to === autoboot; but having this branch
        // allows us to locally toggle that flag for weeding out legacy globals mode
        // dependencies independently
        instance = this.buildInstance();
      }

      instance._bootSync();

      // TODO: App.ready() is not called when autoboot is disabled, is this correct?
      this.ready();

      instance.startRouting();
    }

    // For the asynchronous boot path
    this._bootResolver.resolve(this);

    // For the synchronous boot path
    this._booted = true;
  } catch (error) {
    // For the asynchronous boot path
    this._bootResolver.reject(error);

    // For the synchronous boot path
   throw error;
  }

does anyone have a clue what could be? This only happens occasionally, not always. for example 15 times out of our 60 tests, and not always the same test, but randomly.

Shots in the dark here, but what does your targets.js look like? And is this something that can be replicated manually or just in the automated suite?

I think the code snippet you posted is probably not the ultimate source of the exception. Most likely it is being re-thrown by the last line in the snippet (throw error) but the error is being created somewhere deeper down the call stack.

Is the snippet you posted located at vendor-a83cc45fd7a1bc030160eff353a5a4bd.js line 19832? Or at line 1026? My guess from your stack trace is that 1026 is where the attempt to call a method on a null value is happening, and if so and you can share that line with us it may help get to the bottom of this.

as it’s an older project, we don’t have targets.js at all. we are using: Ember : 3.3.2 Ember Data : 3.3.1

Also for these tests we are using env=test

this is something that only happens in the automated suite. manually we cannot reproduce it.

the snipped i pasted is from line 19832. the lines from 1062 are the following:

// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
  if (it == undefined) throw TypeError("Can't call method on  " + it);
  return it;
};

Ok, we’re on the right track but you’ll need to look higher up the stack from there. That code is from babel-polyfill. Somebody who is calling it is the source of the bug.

So move up the stack to vendor.js line 2595, and then 4509, etc, until you can see who is calling a method on a null.

yep, just doing that, thanks so far!

the issue was around a localstorage not being present for what ever reason used by a package called ember-i18n-fetch-translations. it wasn’t properly checked if it’s available or not. it should have been there, but for what ever reason wasn’t. we decided to go with embeded translations instead of fetched from json files which fixed the issue. but now we have issues with the login procedure (b2c ms login), which also depends on some localstorage stuff, which might be related. could be an issue at browserstack or with our tests :slight_smile:

1 Like