TREEcg / event-stream-client

Deprecated! Use the rdf-connect/ldes-client instead
https://github.com/rdf-connect/ldes-client
Other
14 stars 9 forks source link

@treecg/actor-init-ldes-client Error: Cannot find module '@rdfjs/data-model/lib/blank-node' #57

Open nvdk opened 2 years ago

nvdk commented 2 years ago

I'm running into an error when trying to use the latest @treecg/actor-init-ldes-client (2.5.8):

stack trace:

ldesclient_1  | Error: Cannot find module '@rdfjs/data-model/lib/blank-node'
ldesclient_1  | Require stack:
ldesclient_1  | - /app/node_modules/rdf-ext/lib/BlankNode.js
ldesclient_1  | - /app/node_modules/rdf-ext/lib/DataFactory.js
ldesclient_1  | - /app/node_modules/rdf-ext/index.js
ldesclient_1  | - /app/node_modules/@dexagod/rdf-retrieval/dist/index.js
ldesclient_1  | - /app/node_modules/@treecg/actor-init-ldes-client/lib/EventStream.js
ldesclient_1  | - /app/node_modules/@treecg/actor-init-ldes-client/lib/LDESClient.js
ldesclient_1  | - /app/node_modules/@treecg/actor-init-ldes-client/index.js

This seems to be related to an indirect rdf-ext dependency https://github.com/rdf-ext/rdf-ext/issues/89 .

Edit: while writing out the steps to reproduce I think I found the culprit. We're using @rdfjs/parser-jsonld@1.2.2 to parser the output and this depends on @rdfjs/data-model@1.3.4. This seems to be incompatible with the versions used in @treecg/actor-init-ldes-client@2.5.8.

Steps to reproduce:

  1. npm install @treecg/actor-init-ldes-client
  2. npm install @rdfjs/parser-jsonld
  3. create a index.js file similar to the one in the README
  4. define start as node index.js in package.json file
  5. run it npm start
nvdk commented 2 years ago

In conclusion: It looks like this was caused by @rdfjs/data-model not respecting semver, the 1.3.4 releases contains breaking changes, which in turn caused the upgrade from @rdfjs/parser-jsonld@1.2.1 to @rdfjs/parser-jsonld@1.2.2 to break the app.

Pinning to "@rdfjs/parser-jsonld": "1.2.1"resolved the issue

brechtvdv commented 2 years ago

@rdfjs/parser-jsonld is not installed when installing the ldes-client? Are you sure this dependency is still used by rdf-ext, because I don't see it in its package.json?

pietercolpaert commented 2 years ago

Any update on this?

MPParsley commented 2 years ago

@rdfjs/parser-jsonld is not installed when installing the ldes-client?

@rdfjs/parser-jsonld isn't, but @rdfjs/data-model is:

event-stream-client % yarn why @rdfjs/data-model
yarn why v1.22.19
[1/4] 🤔  Why do we have the module "@rdfjs/data-model"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "@rdfjs/data-model@1.3.4"
info Has been hoisted to "@rdfjs/data-model"
info Reasons this module exists
   - "workspace-aggregator-13219bb5-bae8-486d-b0f2-ee83de5e3bad" depends on it
   - Hoisted from "_project_#@treecg#actor-init-ldes-client#@treecg#types#clownface#@rdfjs#data-model"
   - Hoisted from "_project_#@treecg#actor-init-ldes-client#@treecg#types#@rdfjs#dataset#@rdfjs#data-model"
   - Hoisted from "_project_#@treecg#actor-init-ldes-client#@dexagod#rdf-retrieval#rdf-ext#@rdfjs#data-model"
   - Hoisted from "_project_#@treecg#actor-init-ldes-client#@treecg#types#clownface#@rdfjs#namespace#@rdfjs#data-model"
   - Hoisted from "_project_#@treecg#actor-init-ldes-client#@treecg#types#clownface-shacl-path#@tpluscode#rdf-string#@rdf-esm#data-model#@rdfjs#data-model"
   - Hoisted from "_project_#@treecg#actor-init-ldes-client#@treecg#types#clownface-shacl-path#@tpluscode#rdf-string#@zazuko#rdf-vocabularies#@rdfjs#parser-n3#@rdfjs#data-model"
info Disk size without dependencies: "156KB"
info Disk size with unique dependencies: "292KB"
info Disk size with transitive dependencies: "2.02MB"
info Number of shared dependencies: 2
=> Found "@treecg/actor-init-ldes-client#@rdfjs/data-model@1.3.3"
info This module exists because "_project_#@treecg#actor-init-ldes-client" depends on it.
info Disk size without dependencies: "156KB"
info Disk size with unique dependencies: "168KB"
info Disk size with transitive dependencies: "2.05MB"
info Number of shared dependencies: 4
✨  Done in 0.96s.

See https://github.com/TREEcg/event-stream-client/blame/main/packages/actor-init-ldes-client/package.json#L61