Missing dependency `p-limit`

Open Beginner friendly
#465 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
node.js, typescript
Domain
api

Research direction

Inspect package.json and the DirectUploadClient entry named in the require stack, then reproduce the failure with a clean consumer install. Verify whether p-limit is declared and included in the published package dependencies. Done means importing the client no longer requires consumers to add p-limit themselves.

Written by the indexing model from the issue text.

Description

I included @iqss/dataverse-client-javascript as a dependency in a small project, and got the following error message:

Error: Cannot find module 'p-limit'
Require stack:
- /app/node_modules/@iqss/dataverse-client-javascript/dist/files/infra/clients/DirectUploadClient.js
- /app/node_modules/@iqss/dataverse-client-javascript/dist/files/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1569:15)
    at wrapResolveFilename (node:internal/modules/cjs/loader:1123:27)
    at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1147:10)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1174:12)
    at Module._load (node:internal/modules/cjs/loader:1346:5)
    at wrapModuleLoad (node:internal/modules/cjs/loader:261:19)
    at Module.require (node:internal/modules/cjs/loader:1679:12)
    at require (node:internal/modules/helpers:196:16)
    at Object.<anonymous> (/app/node_modules/@iqss/dataverse-client-javascript/dist/files/infra/clients/DirectUploadClient.js:17:35)
    at Module._compile (node:internal/modules/cjs/loader:1934:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/app/node_modules/@iqss/dataverse-client-javascript/dist/files/infra/clients/DirectUploadClient.js',
    '/app/node_modules/@iqss/dataverse-client-javascript/dist/files/index.js'
  ]
}

I had to also add p-limit dependency to my project to resolve the error, although I don't directly use it.

Should the p-limit dependency be added to this project's package.json?

Dominant language
TypeScript
Stars
20
Forks
11
Avg merge
2d 5h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IQSS/dataverse-client-javascript

All issues in IQSS/dataverse-client-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.