Ember.js: currentWhen.split is not a function

Created on 4 Sep 2015  路  16Comments  路  Source: emberjs/ember.js

Upgrading from 1.12 to 1.13.9 I'm seeing a an issue using the current-when argument on a link-to helper resulting in an error Uncaught TypeError: currentWhen.split is not a function. This twiddle demonstrates the problem which seems to occur regardless of if currentWhen is defined or not.

Note that the problem doesn't persist if I set current-when directly to a string in the template, but we need to be able to set this dynamically.

Help Wanted Needs backport

Most helpful comment

I'm seeing this again in current canary, not sure when it regressed

All 16 comments

Looks like this is fixed in canary:
http://ember-twiddle.com/50efad9f9a81c9b5613b

Awesome, thanks for checking/confirming!

Will that fix be back ported to 1.13 @rwjblue?

@Dhaulagiri - I'm not sure which commit fixes it. I am not opposed to backporting if someone tracks it down, and it is safe enough for immediate release.

I can try to look, but I'm not super familiar with the Ember code base. This is a blocking issue for our 1.13 upgrade though so I will try to make some time.

@rwjblue I would like for us to chat about this class of issue at the meeting today. We need a stance on upgrade blocking bugs, as they can undermine our ease of upgrade goals.

Obviously we cannot fix all. But I want to make sure everyone's understanding is aligned.

This is also fixed in 2.0. The difference seems to be in this particular case that current-when is an object in 1.13 wheres in >= 2.0 (and presumably 1.12), it is a string.

A quick glance suggests we are leaking MUTABLE_CELL

screen shot 2015-09-11 at 2 46 09 pm

ya we are leaking it and potentially others here

@wycats hinted at get-value

a quick check confirms getValue instead of direct attrs interaction will solve the issue.

Ember.__loader.require("ember-htmlbars/hooks/get-value").default(view.attrs['current-when'])

So all the attrs[..] calls, should be replace with getValue(attrs[...])

example:

import getValue from 'ember-htmlbars/hooks/get-value';
...

var currentWhen getValue(attrs['current-when'])

@Dhaulagiri do you have any spare cycles to do ^^ ?

@stefanpenner provided I can get some guidance as needed I'm happy to do the leg work early next week

Closed by #12344

thanks @Dhaulagiri :)

I'm seeing this again in current canary, not sure when it regressed

I am also seeing this again with Ember 2.8.0 LTS.

Was this page helpful?
0 / 5 - 0 ratings