Skip to content

CommonJS and type exports point to missing dist files #3

Description

@erliona

Summary

@agenticmail/enterprise@0.5.615 publishes a CommonJS and type root export that points to missing files.

ESM import points to ./dist/index.js, which exists. The require and types conditions point to ./dist/index.cjs and ./dist/index.d.ts, but those files are not included in the npm package.

Reproduction

tmp="$(mktemp -d)"
cd "$tmp"
npm init -y >/dev/null
npm install --ignore-scripts @agenticmail/enterprise@0.5.615

node - <<'NODE'
const fs = require('node:fs');
const path = require('node:path');
const root = path.join(process.cwd(), 'node_modules/@agenticmail/enterprise');
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));

console.log(pkg.exports['.']);
for (const file of ['dist/index.js', 'dist/index.cjs', 'dist/index.d.ts', 'bin/agenticmail-enterprise.cjs']) {
  console.log(file, fs.existsSync(path.join(root, file)));
}
NODE

node - <<'NODE'
try {
  require('@agenticmail/enterprise');
} catch (error) {
  console.error(error.code);
  console.error(error.message.split('\n')[0]);
  process.exit(1);
}
NODE

Actual behavior

CommonJS require('@agenticmail/enterprise') fails with MODULE_NOT_FOUND because dist/index.cjs is absent. The package also advertises missing dist/index.d.ts types.

Expected behavior

The require and types export conditions should point to included files, or those conditions should be removed if the package is ESM-only.

Environment used to reproduce: macOS, Node v24.10.0, npm 11.6.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions