Robert
Robert

Reputation: 779

Syncfusion TreeGrid + Angular 11 "Error: inject() must be called from an injection context"

I wanted to use Syncfusion TreeGrid in my Angular solution but when I imported module and added it to component I'm getting following error:

core.js:6210 ERROR Error: Uncaught (in promise): Error: inject() must be called from an injection context
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:493)
    at getNodeInjectable (core.js:3596)
    at instantiateAllDirectives (core.js:10280)
    at createDirectivesInstances (core.js:9629)
    at ɵɵelementStart (core.js:14837)
    at Module.ɵɵelement (core.js:14888)
    at TreeDemoComponent_Template (tree-demo.component.html:9)
    at resolvePromise (zone-evergreen.js:1213)
    at resolvePromise (zone-evergreen.js:1167)
    at zone-evergreen.js:1279
    at ZoneDelegate.invokeTask (zone-evergreen.js:406)
    at Object.onInvokeTask (core.js:28540)
    at ZoneDelegate.invokeTask (zone-evergreen.js:405)
    at Zone.runTask (zone-evergreen.js:178)

I'm sure it's not issue with my project configuration because same occurs when trying to run Sync fusion example.

Building on following Angular version:

Angular CLI: 11.2.6
Node: 15.5.0
OS: win32 x64
Package Version

@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)

Upvotes: 2

Views: 490

Answers (2)

user15800433
user15800433

Reputation: 9

We would like to inform you that currently, Syncfusion EJ1 components do not support Angular 11. We only have support till Angular 8. However, we have already logged a feedback to provide support for Angular 9. You van track its status from the below link.

Feedback: https://www.syncfusion.com/feedback/12334/provide-angular-9-support-for-ej1-components

However, as we have already lined up some major features, we could not implement this support immediately. We will implement this and include it in any of our upcoming releases. Please cast your vote on this feature based on the customer demand we will prioritize the features in our upcoming road map.

We would like to suggest our EJ2 TreeGrid component, which supports Angular 11. To learn more about EJ2-TreeGrid, please find the Online Documentation and Samples from the below links.

Documentation: https://ej2.syncfusion.com/angular/documentation/treegrid/getting-started/

Samples: https://ej2.syncfusion.com/angular/demos/#/material/treegrid/treegrid-overview

Upvotes: 0

Robert
Robert

Reputation: 779

If found temoporary worakroud by adding following "paths" entry for compilerOptions in tsconfig.app.json

 "paths": {
  "@angular/*": [
    "./node_modules/@angular/*"
  ]
}

Upvotes: 3

Related Questions