I have upgraded to latest ember v6.5 and although the app builds without any errors on launch, all v1 add-on services for example @service router produce this error:
helpers.js:115 Uncaught Error: Assertion Failed: Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.
Also I have detected that all getOwner(this) inside the add-on services that have @service lines also produce undefined.
I have searched all deprecations and I haven’t found anything about that. Previous ember version v6.3 builds normally.
I am also struggling with this problem after upgrading an existing app to use embroider. If you want to integrate an addon which uses a service, and you try to access this service, you get an error.
I made a minimal example if you want to have a look:
(they must be placed relative to each other to make the deps work).
As far as the addon uses a service, an error is thrown.
assert.js:43 Uncaught Error: Assertion Failed: Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.
at assert (assert.js:43:13)
at FoobarService.getInjection (cache-fCezwMOy.js:1881:99)
at eval (cache-fCezwMOy.js:1160:23)
at untrack (index.js:468:12)
at ComputedProperty.get (cache-fCezwMOy.js:1159:75)
at FoobarService.getter [as store] (cache-fCezwMOy.js:312:23)
at get hello (foobar.js:56:10)
at getPossibleMandatoryProxyValue (cache-fCezwMOy.js:1646:17)
at _getProp (cache-fCezwMOy.js:1710:15)
at eval (index.js:112:145)
Debugging it leads to the underlying getOwner(this) is null problem.
(they must be placed relative to each other to make the deps work).
how are they linked? normally you have to install the addon from the filepath (rather than npm link) so that npm/pnpm can eliminate duplicate dependencies so things work correctly