ontologies icon indicating copy to clipboard operation
ontologies copied to clipboard

Cannot build - problem with @types/n3

Open flyon opened this issue 3 years ago • 3 comments

hey guys, great library. Ive been messing with my own ontology files since forever and have been thinking of building something exactly like this. But you already built it, and in a very clean and functional way by the looks of it. 👌

I wanted to build it locally and play with some things. But I get an error for @types/n3 on this line:

image

Here's the full error.

Never seen something like that in types. Maybe n3 type dependency is too loose together with typescript dependency?

ontola\ontologies\core> yarn build
yarn run v1.22.5
$ pika build
@pika/pack v0.5.0
[1/7] Validating source...
[2/7] Preparing pipeline...
      ❇️  pkg\
../node_modules/@types/n3/index.d.ts(175,47): error TS1110: Type expected.
../node_modules/@types/n3/index.d.ts(177,40): error TS1110: Type expected.

Error: Command failed with exit code 2 (Unknown system error -2): C:\web\dacore\ontola\ontologies\core\node_modules\typescript\bin\tsc --outDir C:\web\dacore\ontola\ontologies\core\pkg\dist-src\ -d --
declarationDir C:\web\dacore\ontola\ontologies\core\pkg\dist-types\ --project C:\web\dacore\ontola\ontologies\core\tsconfig.json --target es2019 --module esnext --noEmit false --sourceMap false       
    at makeError (C:\web\dacore\ontola\ontologies\core\node_modules\execa\lib\error.js:59:11)
    at handlePromise (C:\web\dacore\ontola\ontologies\core\node_modules\execa\index.js:112:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Object.build (C:\web\dacore\ontola\ontologies\core\node_modules\@pika\plugin-ts-standard-pkg\dist-node\index.js:139:3)
    at async C:\web\dacore\ontola\ontologies\core\node_modules\@pika\pack\dist-node\index.js:2375:11
    at async Build.init (C:\web\dacore\ontola\ontologies\core\node_modules\@pika\pack\dist-node\index.js:2459:7)

flyon avatar Jan 17 '22 03:01 flyon

Yes, looks like it. Typescript supports "template literal strings" from version 4.1 I've tried downgrading @types/n3 to "1.10.0", which is the last version tagged with typescript 3 and then ran yarn install but now I get a different error

../node_modules/@types/n3/index.d.ts(14,22): error TS2307: Cannot find module 'rdf-js'.

Ideas?

flyon avatar Jan 17 '22 04:01 flyon

The last one looks like @types/n3 has rdf-js as a peer dependency, which therefore has to be added as a dev dependency

rescribet avatar Jan 18 '22 12:01 rescribet

well spotted, got it to work now with a few other changes, submitted a PR

flyon avatar Jan 19 '22 05:01 flyon