Defining a property on an Ember Component named "container" causes an exception in Production build of Ember
See original GitHub issueHi All,
I recently encountered an issue when upgrading from Ember 2.9.1 to 2.13.0. I didn’t see anything the Ember guides or docs about this, but please correct me if I missed it. It seems when you add a “container” property to a component you get the following error - only when serving your app with the production build of Ember . If this is not documented I would be happy to contribute. It seems we could also handle the exception with a more informative message to track down the source of the bug.
I was able to track down the source with the help of this SO post https://stackoverflow.com/questions/35155198/how-solve-this-using-the-injected-container-is-deprecated-ember-2-3.
I’ve put together a demo repo with Ember 2.13 that reproduces the bug. https://github.com/hudakdidit/ember-container-property-production-bug
To reproduce you can run ember build --environment production and put the dist folder on a running server or run a local node server like http-server.
vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:12 TypeError: Cannot read property '__container__' of undefined
at a.get (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:8)
at R (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:12)
at A (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:12)
at e.H.applyPartial (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:12)
at Function.a.proto (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:16)
at new a (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:15)
at Function.u.create (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:16)
at e.create (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:8)
at r.create (vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:10)
at vendor-35d6ff4933cc1e156ce04e2c2d52162f.js:4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (7 by maintainers)

Top Related StackOverflow Question
Interestingly, a production build of https://github.com/hudakdidit/ember-container-property-production-bug seems to work in Ember
2.15and2.16, but not2.13or2.14. Upgrading to2.15might be a good pathUpgrading seems a like a totally valid path to resolve the issue. Closing.