Hi,
wanted to play around with tree grid to see if this is suitable for my need, but provided sample repo does not work properly.
Tried running with the newest verstion of "^19.1.58", but still fails.
Steps:
Clone repo
npm install
npm start
open localhost:4200
and you will get:
main.ts:12 Error: inject() must be called from an injection context
at injectInjectorOnly (core.js:4708)
at ɵɵinject (core.js:4718)
at Module.ɵɵdirectiveInject (core.js:14619)
at NodeInjectorFactory.TreeGridComponent_Factory [as factory] (ej2-angular-treegrid.js:486)
at getNodeInjectable (core.js:3596)
at instantiateAllDirectives (core.js:10280)
at createDirectivesInstances (core.js:9629)
at Module.ɵɵelementStart (core.js:14837)
at AppComponent_Template (app.component.html:1)
at executeTemplate (core.js:9600)
Same for me. Building on following Angular version:
Angular CLI: 11.2.6
Node: 15.5.0
OS: win32 x64
@angular-devkit/architect 0.1102.6 (cli-only)
@angular-devkit/core 11.2.6 (cli-only)
@angular-devkit/schematics 11.2.6 (cli-only)
@schematics/angular 11.2.6 (cli-only)
@schematics/update 0.1102.6 (cli-only)
Also created an issue on your gthub:
Unfortunately this is not correct answer.it is not related with node version.
This answer is correct
https://stackoverflow.com/questions/67189702/syncfusion-treegrid-angular-11-error-inject-must-be-called-from-an-injecti
|
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [],
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
} |
The workaround mentioned above ist not needed if the installed Angular version is <= 12.2.8.
I use use ~12.2.8 as version definition for Angular. So it might that after npm update I get a newer version. Currently the verison is 12.2.13 (wanted version). Then this workaround above is needed. I want to prevent the use of this workaround.
Why are Syncfusion packages locked to a maximum version e.g. 12.2.8 and not to ~12.2.8?
Hi Pon Selva,
to be honest, I currently cannot reproduce the issue anymore in none of my projects. It works. Previously I hat installed latest version of node. Maybe version 16 had this kind of issues since angular 12 works with 14
Regards,
Michael