angulartypescriptangular-libraryangular-kendo

Uncaught Error: Invalid provider for MissingTranslationHandler. useClass cannot be undefined


I am using kendo library in my angular project. I have my own library which I used for common components. I have a kendo grid in library in which I need to implement kendo multicheck filter where I am encountering following issue.

Uncaught Error: Invalid provider for MissingTranslationHandler. useClass cannot be undefined.

Usually it happens when:

  1. There's a circular dependency (might be caused by using index.ts (barrel) files).
  2. Class was used before it was declared. Use forwardRef in this case.

I have used forward reference as it is showing error for translator service.

forwardRef(() => TranslateService)

But this is not working in my case.

Here are my details: I have built custom component for multicheck filter to apply filter while using child component created in library. If I use it in my any of other project which are using this library. it works well. But now I have use it in component which is in library and it is commonly used in children of same module. In which case this error occurs.

<ng-template kendoGridFilterMenuTemplate let-column="column" let-filter="filter" let-filterService="filterService">
    <atuin-filter-multicheck [isPrimitive]="false" [field]="column.field" [currentFilter]="filter"
           [filterService]="filterService" textField="name" valueField="pkSeasonID"
           [data]="validSeasonList">
    </atuin-filter-multicheck>
</ng-template>

Solution

  • I have found solution for this circular dependency. I have build a custom library for my common components. I had classified components on the basis of usage in library. Like if I have tables, then it has a table-module, Filter-Module for Filtration, modal-Module for all kind of modals. I was using filter-component from Filter Module in table-component registered in table-module. At the time of build both modules are at same level and both are not build so that creates circular dependency error.

    to resolve this issue we have to registered components in same module which will resolve your issue. There is no solution for library circular dependency issue. There are solutions available of component but not for library.