-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Bug] String injection with instantiate: false
no longer works on ember 3.27.0
#19532
Labels
Comments
as workaround, application.register('config:a-string', { toString() => 'My great injected string' }, {
instantiate: false,
}); may work |
The mentioned workaround fixes the issue in modal-dialog for me |
The same issue affects ember-model-validator. |
m1nl
added a commit
to m1nl/pompa
that referenced
this issue
Jun 15, 2021
m1nl
added a commit
to m1nl/pompa-docker
that referenced
this issue
Jun 15, 2021
m1nl
added a commit
to m1nl/pompa-docker
that referenced
this issue
Jun 22, 2021
I have the same issue with 3.28.0, but while trying to inject some numeric constants in components. |
@andsmedeiros your case will be: application.register('config:a-number', { [Symbol.toPrimitive]() { return 42 } }, {
instantiate: false,
}); |
Thanks @lifeart, this does the trick. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐞 Describe the Bug
Injecting a string via dependency injection raise an error.
🔬 Minimal Reproduction
Minimal reproduction on fresh app : https://github.com/romgere/test-ember-string-injection
To sum-up
Try to inject a string into a service with an initializer :
😕 Actual Behavior
When trying to use the service property got the following error :
Uncaught TypeError: Cannot create property 'Symbol(INIT_FACTORY)' on string 'My great injected string'
🤔 Expected Behavior
The property is setted with injected string.
🌍 Environment
➕ Additional Context
Related to what is done in https://github.com/yapplabs/ember-modal-dialog, see yapplabs/ember-modal-dialog#320.
The text was updated successfully, but these errors were encountered: