The New Way to Build! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Learn More

Error at installing Metronic Angular Theme

Hello support Team, I got an error at installing Metronic Angular Theme. I am stuck. Would you help me to solve the issue?

Currently using

Angular CLI: 17.3.6 Node: 20.12.2 Package Manager: npm 10.5.0 OS: win32 x64

After using ng serve command compiled failed. Getting this error

Build at: 2024-04-30T09:58:59.762Z - Hash: 3690ff27de5d065d - Time: 19982ms

./src/styles.scss - Warning: Module Warning (from ./node_modules/@angular-devkit/build-angular/node_modules/postcss-loader/dist/cjs.js): (47893:3) from "autoprefixer" plugin: start value has mixed support, consider using flex-start instead

Code: align-items: start

Error: node_modules/angular-datatables/src/angular-datatables.directive.d.ts:31:25 - error TS2314: Generic type 'Api<T>' requires 1 type argument(s).

31 dtInstance: Promise<Api>; ~~~

Error: src/app/modules/crud/crud.component.ts:10:10 - error TS2614: Module '"datatables.net"' has no exported member 'Settings'. Did you mean to use 'import Settings from "datatables.net"' instead?

10 import { Settings } from 'datatables.net'; ~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:19:20 - error TS2503: Cannot find namespace 'DataTables'.

19 datatableConfig: DataTables.Config = {}; ~~~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:35:14 - error TS2503: Cannot find namespace 'DataTables'.

35 dtOptions: DataTables.Settings = {}; ~~~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:76:60 - error TS2503: Cannot find namespace 'DataTables'.

76 this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.ajax.reload()); ~~~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:180:62 - error TS2503: Cannot find namespace 'DataTables'.

180 this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.search(value).draw()); ~~~~~~~~~~

Error: src/app/pages/permission/permission-listing/permission-listing.component.html:30:19 - error NG8002: Can't bind to 'datatableConfig' since it isn't a known property of 'app-crud'.

  1. If 'app-crud' is an Angular component and it has 'datatableConfig' input, then verify that it is part of this module.
  2. If 'app-crud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

30 <app-crud [datatableConfig]="datatableConfig" route="/apps/users" (deleteEvent)="delete($event)" (editEvent)="edit($event)" (createEvent)="create()" [reload]="reloadEvent" [modal]="formModal"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app/pages/permission/permission-listing/permission-listing.component.ts:11:16 11 templateUrl: './permission-listing.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component PermissionListingComponent.

Error: src/app/pages/role/role-details/role-details.component.html:70:27 - error NG8002: Can't bind to 'datatableConfig' since it isn't a known property of 'app-crud'.

  1. If 'app-crud' is an Angular component and it has 'datatableConfig' input, then verify that it is part of this module.
  2. If 'app-crud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

70 <app-crud [datatableConfig]="datatableConfig" (deleteEvent)="deleteUser($event)" [reload]="reloadEvent"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app/pages/role/role-details/role-details.component.ts:9:16 9 templateUrl: './role-details.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component RoleDetailsComponent.

Error: src/app/pages/user/user-listing/user-listing.component.html:30:15 - error NG8002: Can't bind to 'datatableConfig' since it isn't a known property of 'app-crud'.

  1. If 'app-crud' is an Angular component and it has 'datatableConfig' input, then verify that it is part of this module.
  2. If 'app-crud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

30 <app-crud [datatableConfig]="datatableConfig" route="/apps/users" (deleteEvent)="delete($event)" (editEvent)="edit($event)" (createEvent)="create()" [reload]="reloadEvent" [modal]="formModal"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app/pages/user/user-listing/user-listing.component.ts:12:16 12 templateUrl: './user-listing.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component UserListingComponent.

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

× Failed to compile. ✔ Browser application bundle generation complete.

Initial chunk files | Names | Raw size runtime.js | runtime | 14.45 kB |

22 unchanged chunks

Build at: 2024-04-30T09:59:01.779Z - Hash: a4abc3582acd83df - Time: 1304ms

Error: node_modules/angular-datatables/src/angular-datatables.directive.d.ts:31:25 - error TS2314: Generic type 'Api<T>' requires 1 type argument(s).

31 dtInstance: Promise<Api>; ~~~

Error: src/app/modules/crud/crud.component.ts:10:10 - error TS2614: Module '"datatables.net"' has no exported member 'Settings'. Did you mean to use 'import Settings from "datatables.net"' instead?

10 import { Settings } from 'datatables.net'; ~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:19:20 - error TS2503: Cannot find namespace 'DataTables'.

19 datatableConfig: DataTables.Config = {}; ~~~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:35:14 - error TS2503: Cannot find namespace 'DataTables'.

35 dtOptions: DataTables.Settings = {}; ~~~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:76:60 - error TS2503: Cannot find namespace 'DataTables'.

76 this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.ajax.reload()); ~~~~~~~~~~

Error: src/app/modules/crud/crud.component.ts:180:62 - error TS2503: Cannot find namespace 'DataTables'.

180 this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.search(value).draw()); ~~~~~~~~~~

Error: src/app/pages/permission/permission-listing/permission-listing.component.html:30:19 - error NG8002: Can't bind to 'datatableConfig' since it isn't a known property of 'app-crud'.

  1. If 'app-crud' is an Angular component and it has 'datatableConfig' input, then verify that it is part of this module.
  2. If 'app-crud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

30 <app-crud [datatableConfig]="datatableConfig" route="/apps/users" (deleteEvent)="delete($event)" (editEvent)="edit($event)" (createEvent)="create()" [reload]="reloadEvent" [modal]="formModal"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app/pages/permission/permission-listing/permission-listing.component.ts:11:16 11 templateUrl: './permission-listing.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component PermissionListingComponent.

Error: src/app/pages/role/role-details/role-details.component.html:70:27 - error NG8002: Can't bind to 'datatableConfig' since it isn't a known property of 'app-crud'.

  1. If 'app-crud' is an Angular component and it has 'datatableConfig' input, then verify that it is part of this module.
  2. If 'app-crud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

70 <app-crud [datatableConfig]="datatableConfig" (deleteEvent)="deleteUser($event)" [reload]="reloadEvent"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app/pages/role/role-details/role-details.component.ts:9:16 9 templateUrl: './role-details.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component RoleDetailsComponent.

Error: src/app/pages/user/user-listing/user-listing.component.html:30:15 - error NG8002: Can't bind to 'datatableConfig' since it isn't a known property of 'app-crud'.

  1. If 'app-crud' is an Angular component and it has 'datatableConfig' input, then verify that it is part of this module.
  2. If 'app-crud' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

30 <app-crud [datatableConfig]="datatableConfig" route="/apps/users" (deleteEvent)="delete($event)" (editEvent)="edit($event)" (createEvent)="create()" [reload]="reloadEvent" [modal]="formModal"> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/app/pages/user/user-listing/user-listing.component.ts:12:16 12 templateUrl: './user-listing.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component UserListingComponent.

× Failed to compile.

Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi Asib Al

It looks like there was an update to the DataTable plugin that requires some code changes.

You'll need to change your import statement and how you define the datatableConfig variable. Here's how you can update your code:

Before:

datatableConfig: DataTables.Settings = {};

After:

import { Config } from "datatables.net";
datatableConfig: Config = {};

Please make these changes in your code, and the issue should be resolved. Or you can download the updated angular demo1 from here:



If you need further assistance, feel free to ask.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(