Skip to content

npm package fails to import in 0.2.23 because published tarball is missing dist/index.js #376

@marioja

Description

@marioja

Summary

ruvector@0.2.23 cannot be imported after a fresh install because the published npm package declares:

  • main: dist/index.js
  • types: dist/index.d.ts

but the published tarball does not include those files.

Severity

High

Environment

  • npm registry package: ruvector@0.2.23
  • Node: reproduced on Node 20+
  • Package manager: reproduced with pnpm
  • Also reproduced with CommonJS require()

Expected Behavior

A fresh install of ruvector@0.2.23 should allow:

await import('ruvector')

and/or:

require('ruvector')

without runtime resolution errors.

Actual Behavior

Both ESM import and CJS require fail because Node cannot resolve dist/index.js from the installed package.

ESM error

Error: Cannot find package '.../node_modules/ruvector/dist/index.js' imported from ...

CJS error

Error: Cannot find module '.../node_modules/ruvector/dist/index.js'. Please verify that the package.json has a valid "main" entry

Steps to Reproduce

  1. Create an empty directory.
  2. Add a package.json with:
{
  "name": "ruvector-023-check",
  "private": true,
  "dependencies": {
    "ruvector": "0.2.23"
  }
}
  1. Install dependencies.
  2. Run:
node -e "import('ruvector').then(()=>console.log('esm-ok')).catch(err=>{console.error(err);process.exit(1)})"
  1. Run:
node -e "try{require('ruvector');console.log('cjs-ok')}catch(err){console.error(err);process.exit(1)}"

Additional Evidence

Running:

npm view ruvector@0.2.23 main types

returns:

{
  "main": "dist/index.js",
  "types": "dist/index.d.ts"
}

But inspecting the published tarball:

npm pack ruvector@0.2.23
tar -tf ruvector-0.2.23.tgz

shows no package/dist/index.js or package/dist/index.d.ts in the archive.

The tarball appears to include files like src/decompiler/*, bin/*, and wasm/*, but not the declared dist entrypoints.

Impact

  • Fresh installs of ruvector@0.2.23 are unusable as a library.
  • Any project using ^0.2.19 can drift to 0.2.23 and start failing at runtime after reinstalling dependencies.
  • Consumers are forced to pin away from the latest publish or patch the package locally.

Suggested Fix

Republish 0.2.23 (or a newer version) with the built dist/ output included, or update the package entrypoints/files list so the published artifact matches the declared main and types fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions