DataTables 2.0 and TypeScript types for extensions

DataTables 2.0 and TypeScript types for extensions

sadeghbaratisadeghbarati Posts: 14Questions: 4Answers: 0

Link to test case: https://stackblitz.com/edit/vitejs-vite-ggumwx
Debugger code (debug.datatables.net):
Error messages shown:

Argument of type '{ dom: string; buttons: string[]; }' is not assignable to parameter of type 'Config'.
  Object literal may only specify known properties, and 'buttons' does not exist in type 'Config'.(2345)

Description of problem: I have typescript errors with DataTables Extensions imports how to fix typescript errors

Thanks
Sadegh

This question has an accepted answers - jump to answer

Answers

  • sadeghbaratisadeghbarati Posts: 14Questions: 4Answers: 0

    Sry it's ok on Stackblitz after I refreshed the tab, but idk why my IDE still got the problem

  • allanallan Posts: 63,434Questions: 1Answers: 10,458 Site admin
    Answer ✓

    Two things spring to mind:

    1. Make sure you are using the latest versions of all the DataTables components in your package.json file.
    2. Make sure you don't have @types/datatables.net or any of the other @types for datatables.net. All of my libraries contain their own Typescript definiations and you don't need any external types.

    Allan

Sign In or Register to comment.