jeudi 21 mai 2020

EmberJS jQuery deprecation and Foundation

I have an ember project, built using ember-cli, where I use foundation-sites. To initalize foundation, I do

import jQuery from 'jquery';

export default function initFoundation() {
    jQuery(document).foundation();
}

I have @ember/jquery as a dependency, and the code works as expected. However, I get thousands, or even millions of warnings, telling me

Using Ember.$() has been deprecated, use import jQuery from 'jquery'; instead

When I look at the built code, it actually looks like

exports.default = initFoundation;
    function initFoundation() {
        Ember.$(document).foundation();
    }

What am I doing wrong? Is there any way of fixing this warning? Thanks for any help!




Aucun commentaire:

Enregistrer un commentaire