Is Ember CLI experiencing issues due to the latest Ember Data update?

Greetings! I am a beginner with Ember and recently encountered some warnings after upgrading to the latest version of Ember Data:

Update: I have two identical versions of my app, one built without ember-cli and the other with ember cli. Both applications display these warning messages in the console:

DEPRECATION: Usage of snapshot.constructor is deprecated, use snapshot.type instead.

DEPRECATION: Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead.

The first warning appears twice, while the second warning shows up once right after clicking an alert. Here's the code snippet triggering this issue:

The difference lies in the fact that the non-ember-cli built app works without any issues!

It seems like this could be related to a problem within ember-cli

import Ember from 'ember';

export default Ember.Controller.extend({
    sortProperties:["time"],
    sortAscending:true,
    start:new Date(),
    count:0,
    incorrect:0,
    startReview:true,
    showHighScores:false,

    actions:{
        // more action functions here...
    },

Immediately after interacting with the alert, the deprecation warnings appear

Further analysis points to the set and get methods in the code below as potential culprits, but adapting them to comply with the latest Ember Data update has been challenging:

    randomizer:function(){
        this.set("randomArray",this.get("model.text").split(" ").randomize());      
    }.observes("startReview"),
    
    // more functions and logic follow...
});

If you'd like to learn more about the newest release of ember-data, check out this blog post:

Answer №1

It's challenging to identify the root of your issue without seeing the entire context.

In my experience, I encountered a similar problem when using custom serializers. Specifically, I mistakenly used record.get('someproperty') instead of the recommended record.attr('someproperty'). This might be worth checking in your code.

Have you developed your own adapter/serializers or are you relying on existing ones? There is a possibility that the solution you're utilizing hasn't been updated correctly.

UPDATE: Based on feedback, it appears you're using the firebase adapter, which has a known compatibility issue with ember data 0.1.15b. You can refer to https://github.com/firebase/emberfire/issues/226 for more information.

Essentially, they have this line:

json[payloadKey] = Ember.A(record.get(key)).mapBy('id');
in their serializeHasMany function, but it should now be changed to:

json[payloadKey] = Ember.A(record.attr(key)).mapBy('id');

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Combine two scope arrays in AngularJS

Is there a way to merge two arrays of scope in AngularJS within my controller so that I can display them in a single table? The merging would be based on a common field present in both arrays, similar to an SQL join operation where data from both tables ...

Creating a Cordova application from the ground up, evaluating the options of using ngCordova, Ionic framework, and

With the goal of creating a multiplatform Cordova app for Android, iOS, and Windows, I have been exploring different approaches. My plan is to build an application with 4 or 5 features focused on service consumption (listing, adding, and editing items) wh ...

Error message in Ionic 2: "Property is not found on type"

Currently, I am working on a project in Ionic 2 and have encountered a stumbling block with a seemingly simple task. My issue lies with a Textbox where I aim to input text that will then be displayed. I found some code on a website (http://www.tizag.com/j ...

Error: the specified item is not a valid function

As a newcomer to the world of JavaScript, I am eager to learn and explore new concepts. Currently, my focus is on centralizing the code for accessing my MySQL database within my Express JS server using promises. Below is an attempt I have made in achieving ...

Tips for managing large amounts of data retrieval from an API

As a beginner, I am attempting to retrieve data from an API and display it using the v-for directive. However, this process is causing my app to lag. It freezes when new data is fetched or when I search within the list. The following code snippet shows whe ...

Unused function in Vue error compilation

I am facing an issue with the compiler indicating that the function 'show' is defined but never used. The function show is being used in HTML like this: <b-card> <div id="draw-image-test"> <canvas id="can ...

Array logging mistakenly outputs a number

I needed to access the data from JSON outside of the xml function so that I could use it in multiple functions. When I initially logged the data, it displayed arrays with objects in it. However, when I checked the length instead, it returned zero. After re ...

Issues with non-functional plugins that utilize AJAX functionality

I am encountering an issue with my code that includes an ajax script for deleting a record, along with an animation during the deletion process. However, when I try to integrate the ajax script with plugins for confirmation, it seems to not be working prop ...

Performing an asynchronous POST request in JavaScript

Hey there, I successfully managed to implement a post request using ajax for my submit functionality. However, I am now looking to make this asynchronous to account for any delays in processing by my php file. Unfortunately, I am struggling to figure out h ...

Node.js (npm) is still unable to locate python despite setting %PYTHON% beforehand

Trying to get Node.js to work is proving to be more challenging than expected! Despite having two versions of Python on my computer, it seems that Node.js only works with the older version, 2.7. When I encountered an error, it prompted me to set the path ...

When using selenium-python, every attempt to click a button consistently results in an error message

I've been trying to use Python-Selenium binding to click a button, but I haven't had any luck with various selectors so far. I'm currently using Chromedriver. Although I can select an element using elem = driver.find_element(by='xpath& ...

Can I safely keep a JWT in localStorage while using ReactJS?

As I work on developing a single page application with ReactJS, one question comes to mind. I came across information indicating that using localStorage may pose security risks due to XSS vulnerabilities. However, given that React escapes all user input, ...

Tips for effectively combining the map and find functions in Typescript

I am attempting to generate an array of strings with a length greater than zero. let sampleArray2:string[] = ["hello","world","angular","typescript"]; let subArray:string[] = sampleArray2 .map(() => sampleArray2 .find(val => val.length & ...

Implementing an event handler within a functional component using hooks in React

I'm currently exploring functional components and hooks. I have a component that retrieves an array of quotes from an API and is supposed to randomly select one to pass as a prop to a child component named "Quote". import React, {useState, useEffect} ...

The Videojs controls are unresponsive to clicks

Having a strange issue with videojs. I've been attempting to load videojs in the same way as outlined in the documentation, using a dynamic video tag. videojs(document.getElementById('myVideo'), { "controls": true, "autoplay": false, "prelo ...

Experiencing a WEB3js error in a Vite, React, TypeScript application: Troubleshooting TypeError with callbackify function absence

Hey there, I've been experimenting with using web3 in a React client application (specifically with vite react-ts). When trying to call web3.eth.net.getId(), I encountered an error mentioning that callbackify is not a function. After some investigatio ...

Creating an Interactive and Engaging 3D Experience on Facebook with the Power of Javascript API

Looking for suggestions on a 3D API in JavaScript that can be used to create immersive applications on Facebook. Is there something similar to this one: ? Appreciate any insights. ...

Retrieve the next 14 days starting from the current date by utilizing Moment.js

Looking to display the next 14 days in a React Native app starting from today's date. For example, if today is Friday the 26th, the list of days should be: 26 - today 27 - Saturday 28 - Sunday 01 - Monday 02 - Tuesday ............ 12 - Friday Is ther ...

Trying to transfer data from a child component to a parent component in a Firebase-powered React application

Currently in the process of constructing a React Firebase blog and my objective is to transfer {color} from the ViewPosts component (child) to the App component (parent). This is an overview of the App: function App() { const [backgroundColor, setBackg ...

Utilizing Angular Firestore in Combination with Await

Upon reviewing this response, I attempted to implement async/await with a firestore call but it seems like I may be overlooking something. The aim is to fetch a collection of 'hex' documents for a hex grid using Snapshot. Initially, I had valueC ...