Skip to content

fix(cli): correct module entrypoint - #3758

Closed
Pugsin wants to merge 1 commit into
apify:masterfrom
Pugsin:codex/fix-cli-module-entry
Closed

Pugsin wants to merge 1 commit into
apify:masterfrom
Pugsin:codex/fix-cli-module-entry

Conversation

@Pugsin

@Pugsin Pugsin commented Jun 17, 2026

Copy link
Copy Markdown

Description

@crawlee/cli currently advertises ./dist/index.mjs as the ESM/module entry, but the TypeScript build emits dist/index.js and dist/index.d.ts only. During publish, scripts/copy.ts rewrites dist/ out of the copied manifest, so this becomes a published ./index.mjs pointer that is not present in the npm tarball.

This PR points module and the exports["."].import condition at ./dist/index.js, matching the emitted file and the existing main/require entry.

Verification

  • npm pack @crawlee/cli@3.17.0 --json
  • confirmed the published tarball contains package/index.js and package/index.d.ts
  • confirmed the published tarball does not contain package/index.mjs, despite current module/exports.import pointing there after publish rewrite
  • node assertion that packages/cli/package.json now has module and exports["."].import set to ./dist/index.js
  • git diff --check

@barjin barjin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @Pugsin !

I'll close this - @crawlee/cli isn't meant to be imported as a module, it's only used via the crawlee bin script, so the module/exports.import fields aren't actually exercised in practice. Not worth carrying the extra diff for this package.

Thank you anyway!

@barjin barjin closed this Jul 13, 2026
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

Successfully merging this pull request may close these issues.

3 participants