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

Create a container on the registry (with registry.container()) before calling lookupFactory. #10313

Closed
twokul opened this issue Jan 30, 2015 · 3 comments · Fixed by #10315
Closed

Comments

@twokul
Copy link
Member

twokul commented Jan 30, 2015

Seems like latest changes to ember's registry resulted in some errors in the way ED registers. Ember canary + ED canary throws this error: Assertion Failed: Create a container on the registry (with registry.container()) before calling lookupFactory.

Here's a demo repo.

@rwjblue @fivetanley thoughts?

@twokul
Copy link
Member Author

twokul commented Jan 30, 2015

seems like this._defaultContainer is not defined on Application's registry when runInitializers is being executed. But it is defined on the application's instance.

@rwjblue
Copy link
Member

rwjblue commented Jan 30, 2015

The container/registry + initializers/instanceInitializers code was recently changed in #10271 (just landed). It might be related.

@rwjblue
Copy link
Member

rwjblue commented Jan 30, 2015

Failing JSBin

The line causing the error in ember-data is here in the store initializer:

container.register('store:main', container.lookupFactory('store:application') || (application && application.Store) || Store);

This definitely seems like a regression from #10271.

@tomdale / @dgeb - Mind taking a look at this one?

dgeb added a commit to dgeb/ember.js that referenced this issue Jan 30, 2015
This ensures that all registries will have a reference to the first
container created that references them.

This ensures that deprecated access to `lookup` and `lookupFactory`
on the registry will be proxied to the first container created for a
registry. This avoids breaking compatibility with Ember 1.x
initializers.

[Fixes emberjs#10313]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants