Angular 13.3 -> 14 Error: NG0203: inject() must be called from an injection context (a constructor, a factory function or a field initializer) #46419
Labels
area: core
Issues related to the framework runtime
core: di
needs reproduction
This issue needs a reproduction in order for the team to investigate further
Milestone
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
I have a monorepo with 3 angular projects. They were working with Angular 13.3 and now with Angular 14 I'm getting this error in the browser console:
I've tried reverting to Angular 13.3 again and everything is working as expected.
The codebase is here: https://github.com/matteobruni/tsparticles/tree/dev (The branch with Angular 14 is dev, not main)
The Component library is here: https://github.com/matteobruni/tsparticles/tree/dev/components/angular
The Angular demo app is here: https://github.com/matteobruni/tsparticles/tree/dev/demo/angular
There's also an Ionic app here: https://github.com/matteobruni/tsparticles/tree/dev/demo/ionic but I'm facing the same issue, so it can be ignored for now.
For running the project you can follow these steps:
yarn
in the root foldernpx lerna bootstrap
npx lerna run build
cd demo/angular
yarn start
And there you'll see the error in the browser console.
Please provide a link to a minimal reproduction of the bug
https://github.com/matteobruni/tsparticles/tree/dev/demo/angular
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)The text was updated successfully, but these errors were encountered: