linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
565 stars 143 forks source link

Error when compiling with Typescript #433

Open bjonnh opened 4 years ago

bjonnh commented 4 years ago

I'm getting these errors when compiling my program with typescript:

ERROR in node_modules/rdflib/src/fetcher.ts(922,7): 922:7 Type 'Promise<[unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]>' is not assignable to type 'T extends (string | NamedNode)[] ? Promise[] : Promise'. 920 | options = Object.assign({}, options) // Take a copy as we add stuff to the options!! 921 | if (uri instanceof Array) {

922 | return Promise.all( | ^ 923 | // @ts-ignore Returns an array of promises. Without this ignore, the type is recursive 924 | uri.map(x => { return this.load(x, Object.assign({}, options)) }) 925 | ) ERROR in node_modules/rdflib/src/store.ts(414,23): 414:23 Property 'statements' does not exist on type 'never'. Property 'statements' does not exist on type 'never'. 412 | this.add(subj.subject, subj.predicate, subj.object, subj.graph) 413 | } else if (isStore(subj)) { 414 | this.add(subj.statements) | ^ 415 | } 416 | return this 417 | } Version: typescript 3.9.7 Time: 6554ms