larksuite / larksuite/node-sdk

Build cleanup is non-portable and consecutive builds fail

Open Beginner friendly
#212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
294
Forks
54
Avg merge
3d 13h
Merged PRs (30d)
4

Description

Summary

The package build script does not clean generated output portably or sequentially, and a second consecutive build fails on Windows.

Affected version

  • @larksuiteoapi/node-sdk 1.73.0
  • main at f54b49f3566c52b54c598194b7ed3015e3e24224

Current script

package.json defines:

"build": "rm -r lib es types & rollup -c"

Reproduction

On Windows 10 with Node 24.14.1 and Yarn 1.22.22:

  1. Remove lib, es, and types so the first run is clean.
  2. Run corepack yarn build: it exits 0 and produces all three outputs.
  3. Run the same command again: it exits 1 with TS5055 because types/index.d.ts is treated as an input that would be overwritten.

The shell also reports that rm is not recognized, so existing output is never removed. A sentinel placed in lib survives the cleanup step.

On POSIX shells, the single & backgrounds rm; it does not sequence cleanup before Rollup, so cleanup and build can race.

Expected behavior

yarn build should remove lib, es, and types synchronously using a cross-platform command, then run Rollup. Repeating the build should succeed without relying on manually cleaned output.

Impact

Local and release builds can fail or consume stale generated declarations/artifacts depending on platform and timing. Because npm pack publishes the existing lib, es, and types directories and there is no prepack, stale output can also reach a package assembled from an uncleared workspace.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in package.json by reviewing the build script and how Rollup consumes the generated directories. Reproduce the issue with corepack yarn build twice on Windows or a POSIX shell, then verify that cleanup completes before the build and that repeated builds succeed without stale lib, es, or types output.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, rollup, typescript
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.