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

Fix MU GlimmerResolver.normalize when fullName is not present #338

Merged
merged 1 commit into from Feb 22, 2019

Conversation

ppcano
Copy link
Contributor

@ppcano ppcano commented Feb 22, 2019

This error is triggered when injecting an MU addon service like:

export default class ApplicationController extends Controller {
  @service('my-addon::hola') hola
}

The change checks that fullName is not empty to avoid triggering the error. The error is triggered when the registry calls normalize at https://github.com/emberjs/ember.js/blob/master/packages/%40ember/-internals/container/lib/registry.ts#L690:

In this case, options.source will be null, but options.namespace is my-addon.

      let normalizedFullName = this.normalize(fullName);
      let normalizedSource = this.normalize(options.source!);

This fix makes that the service can be resolved correctly.

I also wonder if the current implementation of the MU Glimmer.resolve may not cover all the possible cases, because the GlobalsResolver.resolve and ClassicResolver.resolve look different. (Note: I am not familiar with this code).

cc @rwjblue

@rwjblue rwjblue merged commit 89b3583 into ember-cli:master Feb 22, 2019
@rwjblue rwjblue added the bug label Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants