visjs/vis-data

Compile error in data-interface.d.ts

Bella303 opened this issue · 10 comments

When trying to compile vis-data, the following errors appear on the terminal.

Component: vis-data
vis-data Version: 7.1.4
Typescript: 4.8.3
Angular: 14
NPM: 8.19.2
Node: 18.1.0
Created Bug Report on OS and Browser: Microsoft 10 Enterprise, Microsoft Edge

ERRORS:

Error: node_modules/vis-data/declarations/data-interface.d.ts:62:23 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

62 oldData: FullItem<Item, IdProp>[];
~~~~

node_modules/vis-data/declarations/data-interface.d.ts:58:37
58 export interface UpdateEventPayload<Item, IdProp extends string> {
~~~~
This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

Error: node_modules/vis-data/declarations/data-interface.d.ts:68:20 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

68 data: FullItem<Item, IdProp>[];
~~~~

node_modules/vis-data/declarations/data-interface.d.ts:58:37
58 export interface UpdateEventPayload<Item, IdProp extends string> {
~~~~
This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

Error: node_modules/vis-data/declarations/data-interface.d.ts:75:23 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

75 oldData: FullItem<Item, IdProp>[];
~~~~

node_modules/vis-data/declarations/data-interface.d.ts:71:37
71 export interface RemoveEventPayload<Item, IdProp extends string> {
~~~~
This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

Error: node_modules/vis-data/declarations/data-set-part.d.ts:8:102 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

8 export declare abstract class DataSetPart<Item, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" > | "off"> {
~~~~

node_modules/vis-data/declarations/data-set-part.d.ts:8:43
8 export declare abstract class DataSetPart<Item, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" |
"off"> {

This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

tsconfig.json

{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2020",
"dom"
]
},
"angularCompilerOptions": {
// "enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true,
"fullTemplateTypeCheck": true,
"strictPropertyInitialization": false
}
}

Same problem here!!

Component: vis-data
vis-data Version: 7.1.4
Typescript: 4.8.0
Angular: 14.2.0
NPM: 8.9.0
Node: 16.15.1

same here

component : vis-data
vis-data: 7.1.2
Angular : 14.2.5

I'm facing the same

component: ngx-vis: 3.1.0
component-dependency: vis-data: 6.6.1
angular: 14.2.9

I'm facing same issue with angular 14

├── typescript@4.8.4
├── vis-data@7.1.4
├── vis-network@9.1.2
├── vis-util@5.0.3
└── zone.js@0.11.8

Could someone please give workaround

I'm facing the same

component: vis-data: 7.1.4
typescript 4.8.4
angular 15.0.1

Found a temporary workaround for this. In tsconfig.json, add "skipLibCheck": true.
The problem is specific to TypeScript 4.8.x, so reverting to an earlier version might also help (where possible).

{
  "compilerOptions": {
    "skipLibCheck": true
  }
}

@dcbroad3 solution worked, but this seems like a hack and shouldn't be necessary.

@dcbroad3 solution worked, but this seems like a hack and shouldn't be necessary.

I fully agree. This was closed as completed a few weeks ago so it is hopefully fixed, except there hasn't been an update published to npm yet so we're still kind of stuck.

We seem to have some issues with our CI, sorry about that, but it should be released now and work. If it doesn't, feel free to reopen.

PS: The skip lib check thing shouldn't be necessary anymore.

🎉 This issue has been resolved in version 7.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀