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

Confusing message when using wrong inject #15904

Closed
chriskrycho opened this issue Dec 1, 2017 · 1 comment
Closed

Confusing message when using wrong inject #15904

chriskrycho opened this issue Dec 1, 2017 · 1 comment
Labels

Comments

@chriskrycho
Copy link
Contributor

chriskrycho commented Dec 1, 2017

After upgrading to the new modules syntax, I had to revert one small section of my app (complicated story; mostly irrelevant), and in one module I missed converting inject() back to inject.service(). The error message reported is… extremely confusing:

"Assertion Failed: Injected properties must be created through helpers, see 'controller"service'"

I managed to figure it out based on the fact that I knew I'd messed with rewriting injections in those particular modules, but I can imagine that being especially confusing if you didn't. (Note that the codemod eliminates this problem by doing import { inject as service } from '@ember/service', so the error would be different—and clearer—in that case.

This error message should be much clearer.

@chriskrycho
Copy link
Contributor Author

The implementation is here. Should be a simple fix. I'll push a PR for it either tonight or tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants