Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9240539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:12:24+00:00 2026-06-18T08:12:24+00:00

I am upgrading my code to V4 but I have come across a problem

  • 0

I am upgrading my code to V4 but I have come across a problem when copying objects. I think I have apparently implemented the Em.Copyable interface, but Em.Copy is not available to me so I get an error in the console. What have I done wrong? I have setup a simple jsfiddle to show the problem I am getting. I’m sure I’m just missing something, but the documentation has completely changed and there are no examples that are in date any more.

Example

Take this object:

App.Key = Em.Object.create(Em.Copyable, {
    first: 1,
    second: 2
});

And this event (in jsfiddle it is a button, but it could be anything):

doClick: function () {
    var k = Em.copy(App.Key);
}

The following error message is received and code execution is stopped:

Error: assertion failed: Cannot clone an Ember.Object that does not implement Ember.Copyable
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:12:25+00:00Added an answer on June 18, 2026 at 8:12 am

    Ember Object.create() has changed recently, it no longer supports mixins. There are a few alternatives. The most common is to add mixins when extending ember object. For example:

    App.Key = Em.Object.extend(Em.Copyable);
    App.key = Em.Object.create({
      first: 1,
      second: 2
    });
    

    If you really want to use add mixins during create, you can use the new createWithMixins method:

    App.key = Em.Object.createWithMixins(Em.Copyable, {
      first: 1,
      second: 2
    });
    

    Now that your object has the Mixin, you’ll find that the example still fails with: Object [object Object] has no method 'copy'. This is because the Em.Copyable mixin does not actually provide an implementation – it’s just a way of signaling to Ember that your object supports the copy operation. You still need to implement the copy method on your class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a image uploader but I have come across 2 errors. Which are:
I am currently upgrading code for a friends website and have encountered a problem
Okay, so I have some code that worked fine in PHP4 but since upgrading
I have encountered a weird situation while updating/upgrading some legacy code. I have a
I have inherited some really old VC6.0 code that I am upgrading to VS2008
I have a problem when upgrading a django and mysql app with south. I've
We have an application with legacy code that relies on prototype, but we've found
I have come across really frustrating issue related to Unicode text and I am
I was working with XCode 4.3 and having a working code. But after upgrading
I have a project that I'm upgrading from 2008 to 2010. My problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.