ember.jsupgradeember-cli

Ember upgrade to 3.27 TypeError: Ember.computed.alias is not a function


I'm upgrading a project from 3.26 to 3.27 using ember-cli-update, and then this error started happening, As I could see the error is raised when we try to access some method inside @ember/computed like alias. The first time the error occurred was here

1

2

I just commented the line to test and the same error occurred in another addon. So it's not related to the addon but something in the project


Solution

  • It is very possible that this is a version related problem, but I have no advanced knowledge of the history of Ember and just discover it.

    You may use the feature as a free function like this:

    import { alias } from '@ember/object/computed';
    
    const Shirt = Ember.Object.extend({
       colour: 'white',
       color: alias('colour'),
    });