question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecation Warning: Using the injected `container` is deprecated.

See original GitHub issue

Version info

e.g.
DEBUG: -------------------------------
DEBUG: Ember      : 2.5.1
DEBUG: Ember Data : 2.6.1
DEBUG: Firebase   : 3.0.5
DEBUG: EmberFire  : 2.0.0
DEBUG: jQuery     : 2.2.4
DEBUG: -------------------------------

Steps to reproduce

Use this.get('session').fetch() in a beforeModel route hook.

// /app/routes/application.js
export default Ember.Route.extend({
  beforeModel() {
    return this.get('session').fetch().catch(function(){});
  }
});

Expected behavior

Should not throw a deprecation warning

Actual behavior

Throws the following warning:

Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `_lookupFactory` instead. [deprecation id: ember-application.injected-container] See http://emberjs.com/deprecations/v2.x#toc_injected-container-access for more details.
        at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16472:7)
        at raiseOnDeprecation (http://localhost:4200/assets/vendor.js:16380:12)
        at HANDLERS.(anonymous function) (http://localhost:4200/assets/vendor.js:16472:7)
        at invoke (http://localhost:4200/assets/vendor.js:16488:7)
        at deprecate (http://localhost:4200/assets/vendor.js:16441:32)
        at Object.deprecate (http://localhost:4200/assets/vendor.js:26480:37)
        at Object.lookupFactory (http://localhost:4200/assets/vendor.js:43550:24)
        at Object.create (http://localhost:4200/assets/vendor.js:95008:42)
        at instantiate (http://localhost:4200/assets/vendor.js:11633:23)

I have traced this down to line 38 in the addon/torii-providers/firebase.js file:

      default:
        const ProviderClass = this.container.lookupFactory(`firebase-auth-provider:${providerId}`);
        if (!ProviderClass) {
          return this.waitFor_(reject(new Error('Unknown provider')));
        }

This needs to be changed over to use the getOwner method of looking things up.

See: http://emberjs.com/deprecations/v2.x/#toc_injected-container-access

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:10
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mohitsudcommented, Jul 2, 2016

Bump! It would be great if this change could be made.

0reactions
jamesdanielscommented, Sep 28, 2016

We’re cutting 2.0.2 today, this includes the fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deprecation Warning: Using the injected `container` is deprecated ...
Using the injected `container` is deprecated. Please use the `getOwner` helper to access the owner of this object and then call `_lookupFactory` instead....
Read more >
WPSEO_Replace_Vars – deprecation warning - WordPress.org
The “WPSEO_Replace_Vars” service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either...
Read more >
Kubernetes Deprecation Policy
Release API Versions Preferred/Storage Version Notes X v1alpha1 v1alpha1 X+1 v1alpha2 v1alpha2 v1alpha1 is removed, "action required" re... X+2 v1beta1 v1beta1 v1alpha2 is removed, "action required"...
Read more >
The "assetic.filter_manager" service is private [Symfony 3.4]
You should either make the service public, or stop using the container directly and use dependency injection instead. User Deprecated: The ...
Read more >
Deprecated Engine Features - Docker Documentation
As a temporary solution, Docker Engine v20.10 includes a fallback mechanism to allow docker pull to be functional when using a non-compliant registry....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found