`module-sync` export points at `./src/index.js`, so `require('datastore-core')` (and 13 other packages) fails
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- release
Research direction
Start with the root "." export in packages/datastore-core/package.json, where "module-sync" points at ./src/index.js; compare it with packages/blockstore-core/package.json, which already uses ./dist/src/index.js. Apply the same one-line change to the root export of each affected packages/*/package.json, then confirm require("datastore-core") and the other named packages load after a build and pack/install. Done means all 14 packages match blockstore-core and the MODULE_NOT_FOUND error is gone.
Written by the indexing model from the issue text.
Description
In 14 of the 15 packages in this repo, the root "." export added in #369 points "module-sync" at "./src/index.js" instead of "./dist/src/index.js", so require() fails with MODULE_NOT_FOUND because published tarballs only include .ts files under src/.
npm i [email protected] [email protected]
node -e 'require("datastore-core")'
Actual output (Node.js v26.13.0):
node:internal/modules/cjs/loader:772
throw e;
^
Error: Cannot find module '.../node_modules/datastore-core/src/index.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1650:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1639:9)
at resolveExports (node:internal/modules/cjs/loader:765:14)
at Module._findPath (node:internal/modules/cjs/loader:832:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1596:27)
at wrapResolveFilename (node:internal/modules/cjs/loader:1145:27)
at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1169:10)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1196:12)
at Module._load (node:internal/modules/cjs/loader:1370:5)
at wrapModuleLoad (node:internal/modules/cjs/loader:261:19) {
code: 'MODULE_NOT_FOUND',
path: '.../node_modules/datastore-core'
}
Expected output: the module loads without error, matching require("blockstore-core") (whose root "module-sync" is "./dist/src/index.js") and subpath exports like require("datastore-core/memory").
Affected packages and versions tested (also reproduced on main at 58d2e06): [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]. Changing "module-sync": "./src/index.js" to "./dist/src/index.js" in packages/*/package.json fixes require() across all of them.
Credit: https://ucsbplse.github.io/
- Dominant language
- TypeScript
- Stars
- 39
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ipfs/js-stores
-
need/triage
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
need/triage
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
feat: create new core data & blockstore that acts as a cache/buffered storeMay be free again @SgtPooki claimed this 1046 days ago, and no pull request is open. Opendif/medium effort/days kind/enhancement P1 status/in-progress
-
need/triage
Difficulty 1/5 Under an hour Newbie friendliness 45/100
-
datastore-idb .query doesn't work as expectedMay be free again A pull request for this issue was closed without being merged. Openkind/bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
"code source" and "numerique.gouv" links: "new window" mention duplicated in the accessible nameOpenaccessibility
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
numerique-gouv/lasuite-landingpage#315 ·
Maintainers usually reply within 1 day
-
needs:triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
HyeokjaeChoi/vaultme#585 ·
Maintainers usually reply within 1 day
-
enhancement priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
beettlle/pi-smart-router#200 ·