Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ember 3.9 DEPRECATION: Using this.$() in a component has been deprecated, consider using this.element [deprecation id: ember-views.curly-components.jquery-element] #249

Open
arun-prasad-r opened this issue Apr 12, 2019 · 9 comments

Comments

@arun-prasad-r
Copy link

I've recently upgraded to ember 3.9 and I get a ton of this deprecation warning in the console.

DEPRECATION: Using this.$() in a component has been deprecated, consider using this.element [deprecation id: ember-views.curly-components.jquery-element]

In my case the error came from using semantic ui dropdown component. The error originates from the semantic base mixin. (mixins/base.js)

// /assets/addon-tree-output/semantic-ui-ember/mixins/base.js
    getSemanticScope() {
      if (Ember.isPresent(this.get('onElement'))) {
        return this.$(this.get('onElement'));
      }
      return this.$(); //<-- Error
    },
@Unkrass
Copy link
Collaborator

Unkrass commented Apr 25, 2019

I'd appreciate a fix as well.

@nerdiken
Copy link
Contributor

Guys i tried fix this issue here #250 . Hope it helps!

@Polve
Copy link

Polve commented Jun 5, 2019

I would appreciate the fix as well

@MonsieurDart
Copy link

With the version 3.0.4 (tagged yesterday), this issue has been fixed! A simple yarn upgrade semantic-ui-ember and no more warnings. 😊

@allthesignals
Copy link

@MonsieurDart is that true? I'm still seeing the warning after upgrading to 3.0.4.

@MonsieurDart
Copy link

Yep, quite sure. Maybe your warnings also come from an other addon?

@iamareebjamal
Copy link

I'm pretty sure just enabling jquery integration does not stop deprecation messages. You have to move away from this.$ for that

@iamareebjamal
Copy link

https://deprecations.emberjs.com/v3.x/#toc_jquery-apis

@allthesignals
Copy link

allthesignals commented Jan 29, 2020

Right, sorry, some minor detail context: I am seeing this in Ember Octane (3.15) :) which might explain why we're seeing different behavior.

So I think we should find a way to move away from this.$ or some other workaround for addons that require jQuery...

Also, maybe something is up with the deprecation warning? I wonder what would happen if this.$ were defined explicitly in the addon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants