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":"","lineno":19832,"colno":9,"error":{"stack":"TypeError: Can't call method on null\n at module.exports (\n at module.exports (\n at keys (\n at initialize (\n at Anonymous function (\n at Vertices.prototype.each (\n at Vertices.prototype.walk (\n at DAG.prototype.each (\n at DAG.prototype.topsort (\n at _runInitializer ("}}]

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();


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


    // For the asynchronous boot path

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

    // 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