Closed NishalyV closed 2 weeks ago
Angular-datatables 17.0.0 seem to rely on @types/datatables.net@1.10.2 for the types while the official datatables.net package would ship own types.
Try npm i @types/datatables.net@1.10.2
(or matching the version you use)
Worked for me 😄
17.1.0 moved away from @types/datatables.net it seems but we're not yet on that version.
if i use match version also iam getting same error
My versions are
angular-datatables - 12.0.2
types/datatables.net - 1.10.19
datatables.net - 2.0.7
datatables.net-dt - 2.0.7
My code is working after npm install, i again install this npm i @types/datatables.net@1.10.19
.
But i need this should be working in the npm install itself because while moving production or dev we can't install this package again.
1st time install angular-datatables directive, it is pointing to datatables.net -->types-->types.d.ts
after installing particular package it is pointing to @types-->datatables.net -->index.d.ts
Hey NishalyV, I ran into this error when I installed a version higher than @types/datatables.net@1.10.21. I would say install the version in your devDepenendicaes to match the version in the repo.
@NishalyV
tl;dr: I think your only options are:
a) Downgrade the datatables packages to compatible versions:
@types/datatables.net@1.10.28
- The latest types package shipping own dedicated types. Should be compatible with angular-datatables@12.0.2
. datatables.net@1.10.25
. The latest datatables package being compatible with both the @types
and angular-datatables
packagesb) Upgrade your project to Angular 17 and use angular-datatables@17.1.0
, use the latest datatables 2.0.8
and fully remove @types/datatables
.
Longer version
Seems you are mixing incompatible datatables.net
and angular-datatables
versions with also incompatible @types/datatables
.
angular-datatables@12.0.2
uses datatables.net@1.10.22
+ @types/datatables.net@1.10.19
. You are putting newer versions of dependencies underneath angular-datatables. Leading to a weird mix and errors. While angular-datatables
and @types/datatables.net
might be compatible from your setup, your datatables.net
package is not compatible with them.
In angular-datatables@17.1.0
this library here was upgraded to use datatables.net@2.0.3
and dropped @types/datatables.net
. But it requires Angular 17.
Up to @types/datatables.net@1.10.28
was shipping own types. Since @types/datatables.net@1.12.0
they are just forwarding the types to the installed datatables package.
datatables.net
introduced own types in 1.11.0
.
@types/datatables.net
is now considered deprecated&dead.
while using angular-datatables - 12 version or above any version iam getting this error and i can't able to run npm i @types/datatables.net --> this one fixes issue in temporarily again deleting nodemodules and packagelock.json again iam getting error, i can run only npm install