[PR #1884] [MERGED] fix(checkpoint-validation): include cli.ts in exports to generate dist/cli.js #1809

Closed
opened 2026-02-15 20:16:55 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1884
Author: @SkrOYC
Created: 1/11/2026
Status: Merged
Merged: 1/12/2026
Merged by: @christian-bromann

Base: mainHead: fix/checkpoint-validation-cli


📝 Commits (2)

  • 316e22f fix(checkpoint-validation): include cli.ts in exports to generate dist/cli.js
  • 9171658 changeset: add patch for checkpoint-validation

📊 Changes

2 files changed (+10 additions, -0 deletions)

View changed files

.changeset/brown-insects-give.md (+5 -0)
📝 libs/checkpoint-validation/package.json (+5 -0)

📄 Description

Problem

Running bunx @langchain/langgraph-checkpoint-validation --help fails with:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/tmp/.../dist/cli.js'

Root Cause

The package's bin/cli.js imports from ../dist/cli.js, but the build tool (internal/build/index.ts) only compiles files listed in the exports field. The exports field was missing the ./cli entry, so src/cli.ts was never compiled to dist/cli.js.

This bug was introduced in commit e7aeffeb (pnpm migration) when the build system changed from the old yarn lc_build to the new tool that uses the exports field.

Fix

Add the ./cli entry to the exports field in package.json:

"./cli": {
  "input": "./src/cli.ts",
  "import": "./dist/cli.js",
  "require": "./dist/cli.cjs"
}

This tells the build tool to compile src/cli.ts to dist/cli.js and dist/cli.cjs.

Verification

Built locally and confirmed:

  • dist/cli.js and dist/cli.cjs are now generated
  • npm pack --dry-run shows both files in the package
  • node bin/cli.js --help runs successfully

Testing

CI should pass. The CLI was tested manually and works as expected.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/1884 **Author:** [@SkrOYC](https://github.com/SkrOYC) **Created:** 1/11/2026 **Status:** ✅ Merged **Merged:** 1/12/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `fix/checkpoint-validation-cli` --- ### 📝 Commits (2) - [`316e22f`](https://github.com/langchain-ai/langgraphjs/commit/316e22f72252041810576274e3c67a6f45095e2a) fix(checkpoint-validation): include cli.ts in exports to generate dist/cli.js - [`9171658`](https://github.com/langchain-ai/langgraphjs/commit/91716582bac91c4e265c3a99cffb0ff7bd6e304d) changeset: add patch for checkpoint-validation ### 📊 Changes **2 files changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/brown-insects-give.md` (+5 -0) 📝 `libs/checkpoint-validation/package.json` (+5 -0) </details> ### 📄 Description ## Problem Running `bunx @langchain/langgraph-checkpoint-validation --help` fails with: ``` Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/tmp/.../dist/cli.js' ``` ## Root Cause The package's `bin/cli.js` imports from `../dist/cli.js`, but the build tool (`internal/build/index.ts`) only compiles files listed in the `exports` field. The exports field was missing the `./cli` entry, so `src/cli.ts` was never compiled to `dist/cli.js`. This bug was introduced in commit `e7aeffeb` (pnpm migration) when the build system changed from the old `yarn lc_build` to the new tool that uses the `exports` field. ## Fix Add the `./cli` entry to the `exports` field in `package.json`: ```json "./cli": { "input": "./src/cli.ts", "import": "./dist/cli.js", "require": "./dist/cli.cjs" } ``` This tells the build tool to compile `src/cli.ts` to `dist/cli.js` and `dist/cli.cjs`. ## Verification Built locally and confirmed: - `dist/cli.js` and `dist/cli.cjs` are now generated - `npm pack --dry-run` shows both files in the package - `node bin/cli.js --help` runs successfully ## Testing CI should pass. The CLI was tested manually and works as expected. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:16:55 -05:00
yindo closed this issue 2026-02-15 20:16:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1809