Ember.js: after upgrading to ember "2.14.0" app is throwing random different errors in safari

Created on 7 Jul 2017  路  12Comments  路  Source: emberjs/ember.js

Hi,

I just upgraded to ember 2.14.0. Everything works great in Chrome/Firefox, but app in Safari is broken. In previous ember release (2.13.2) worked perfectly, but now I am getting errors like:

owner.lookup is not a function. (In 'owner.lookup('-view-registry:main')', 'owner.lookup' is undefined)

or
null is not an object (evaluating 'm.isInitialized')

or
undefined is not an object (evaluating '_ember.default.getOwner(this).lookup')

or
undefined is not an object (evaluating '(0, _emberUtils.getOwner)(this).__container__') (1)

These happen randomly...on page load... when I click on some link...

Do you have an idea what might be the problem? Again, Ember 2.13.2 worked in Safari as well.

Most helpful comment

Looks like we hit a gnarly safari 10 JIT issue, luckily we were able to work around it. It also seems like safari 11 has already fixed the issue... so that's a good thing.

Backports are in, pending release.

All 12 comments

We have the same problem. Some routes of our app work, other don't.
I have the impression that routes that return an unresolved promise from the beforeModel hook are the ones that fail.
Tried to debug this:
in the route beforeModel hook: Ember.getOwner(this) returns an object
afterwards, in Route.paramsFor: Ember.getOwner(this) returns undefined ('this' is still the same route instance)

@pieter-v can you provide some code?

Just run into this myself. Was first reported as a bug in ember-bootstrap (https://github.com/kaliber5/ember-bootstrap/issues/374), but that addon does not seem to cause this. I was able to reduce the reproduction @varunsudhakar made to the bare minimum:

https://github.com/simonihmig/ember-2-14-safari

It still uses an external dependency (ember-cp-validations), but I don't _think_ the root issue comes from there. However I was not able to reproduce without it /cc @offirgolan

I recorded the following piece showing the reproduction using the repo above:

demo

  • you have to enter a bunch characters (the occurance of the exception seems to be not really deterministic, just happens more or less randomly)
  • when that is the case, you can see that the meta object of that component is null. Also most properties seem to return null, although we still have a valid component in DOM

This also happens only in Safari (Mac, Version 10.1.1 (12603.2.4)), and only with ember 2.14.0.

In our case this also appears to only affect the development builds. Test and production builds work fine.

This is occurring for me in production builds on safari only on OSX (10.1.1) and iOS (10.3). It seems to happen when i trigger a number of actions / inputs quickly. CPU usage during this is also abnormally high.

found why it is failing in development at least
https://github.com/simonihmig/ember-2-14-safari helped out (thanks @simonihmig )

there is two issue here:

  1. DEBUG flag is incorrectly replaced https://cl.ly/3e1a0c2Z2t1L/Image%202017-07-11%20at%2011.02.10%20AM.png
  1. in meta file one debugger counter was missing counters.peakPrototypeWalks (added that https://github.com/emberjs/ember.js/pull/15486)

I think 1 issue should be fixed by person who understands DEBUG striping process

@locks

I'm not spotting the issue in the image, can you explain how DEBUG is mishandled there?

Is it normal behavior to have leftover curly braces? Shouldn't it be if(true){ counters.setCalls++; } instead of { counters.setCalls++; } ?

We deployed Ember 2.14.0 on travis-web yesterday and got ratelimited by Sentry for the number of events logged; our plan allows for 200 events a minute. Here鈥檚 the various errors showing up starting yesterday:

image

I鈥檝e rolled back to Ember 2.13.4 for now and the errors have dropped off:

image

These errors were happening on a production deployment.

I made this test deployment before the reversion, it鈥檚 still on Ember 2.14.0. I can鈥檛 manage to reproduce the errors in Safari locally, frustratingly enough.

If there鈥檚 any information I can provide to help figure out what鈥檚 happening, let me know!

After upgrading an app from Ember 2.11 to Ember 2.14, it's unusable on Safari 10.1. @simonihmig's comment best describes reproduction steps.

The app also uses ember-cp-validations, which may or may not be a coincidence.

For the record, as this has not been mentioned here yet: seems we have a fix ready: https://github.com/emberjs/ember.js/pull/15502. Awesome debugging work, thanks to @krisselden & @stefanpenner! 馃憦

Looks like we hit a gnarly safari 10 JIT issue, luckily we were able to work around it. It also seems like safari 11 has already fixed the issue... so that's a good thing.

Backports are in, pending release.

Was this page helpful?
0 / 5 - 0 ratings