Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nvdk opened this issue Feb 10, 2022 · 4 comments

Comments

@nvdk
Copy link
Contributor

nvdk commented Feb 10, 2022

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 rdf-ext/rdf-ext#89 .

Edit: while writing out the steps to reproduce I think I found the culprit. We're using @rdfjs/[email protected] to parser the output and this depends on @rdfjs/[email protected]. This seems to be incompatible with the versions used in @treecg/[email protected].

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
Copy link
Contributor Author

nvdk commented Mar 1, 2022

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/[email protected] to @rdfjs/[email protected] to break the app.

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

@brechtvdv
Copy link
Collaborator

@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
Copy link
Member

Any update on this?

@MPParsley
Copy link

@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/[email protected]"
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/[email protected]"
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants