SolidLabResearch / Bashlib

A Node.JS and CLI interface for Solid
https://solidlabresearch.github.io/Bashlib/
17 stars 6 forks source link

Build broken? Could not find a declaration file for module '@rdfjs/dataset/DatasetCore'. #45

Closed mvanbrab closed 1 year ago

mvanbrab commented 1 year ago

Problem Getting this on a fresh clone (commit 5fdc69a6037729bdb4bb6af1f5bfd89350e625cf (HEAD -> master, tag: 0.2.3, origin/master, origin/HEAD))

$ npm install

added 768 packages, and audited 769 packages in 34s

152 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
$ npm run build

> solid-bashlib@0.2.3 build
> rm -rf dist/ && tsc

node_modules/@inrupt/solid-client/dist/rdf.internal.d.ts:4:121 - error TS7016: Could not find a declaration file for module '@rdfjs/dataset/DatasetCore'. '/home/mavbraba/git-workingcopies/solid/bashlib-play/Bashlib/node_modules/@rdfjs/dataset/DatasetCore.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/rdfjs__dataset` if it exists or add a new declaration (.d.ts) file containing `declare module '@rdfjs/dataset/DatasetCore';`

4 export declare const rdfJsDataset: <InQuad extends RdfJs.BaseQuad = RdfJs.Quad>(quads?: InQuad[] | undefined) => import("@rdfjs/dataset/DatasetCore")<InQuad>;
                                                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/@inrupt/solid-client/dist/rdf.internal.d.ts:4

Following the suggestion given above doesn't help:

$ npm i --save-dev @types/rdfjs__dataset

added 1 package, and audited 770 packages in 7s

152 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
$ npm run build

> solid-bashlib@0.2.3 build
> rm -rf dist/ && tsc

node_modules/@inrupt/solid-client/dist/rdf.internal.d.ts:4:114 - error TS1340: Module '@rdfjs/dataset/DatasetCore' does not refer to a type, but is used as a type here. Did you mean 'typeof import('@rdfjs/dataset/DatasetCore')'?

4 export declare const rdfJsDataset: <InQuad extends RdfJs.BaseQuad = RdfJs.Quad>(quads?: InQuad[] | undefined) => import("@rdfjs/dataset/DatasetCore")<InQuad>;
                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/@inrupt/solid-client/dist/rdf.internal.d.ts:4

Workaround In package.json, choose known-good FIXED versions for inrupt package causing the problem.

    "@inrupt/solid-client": "1.23.3",

Suggestion To the developer that last built it before committing: add your package-dist.json to the repo (currently it is git-ignored). This will allow us to build with the same versions of dependencies.

mvanbrab commented 1 year ago

I forked the repo and will send a PR after some testing of the suggested solution.

mvanbrab commented 1 year ago

It would be nice to have a new release 0.2.4 including the fix...