Deprecation Warning: Using the injected `container` is deprecated.
See original GitHub issueVersion 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:
- Created 7 years ago
- Reactions:10
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Bump! It would be great if this change could be made.
We’re cutting 2.0.2 today, this includes the fix.