MoonshotAI / MoonshotAI/kimi-code

apps/vscode: VSIX packaging fails on main — bare "immer" import remains in extension.js

Open Beginner friendly
#3,252 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Problem

pnpm -C apps/vscode run build && pnpm -C apps/vscode run package:platform fails on current main (checked at d1a46db9):

VSIX packaging failed: Bare runtime dependency "immer" remains in extension/dist/extension.js.

The built dist/extension.js keeps a top-level import { ... } from "immer", which scripts/vsix-verify.mjs rejects.

Cause

  • #2909 added immer imports to packages/agent-core-v2 (e.g. src/state/state.ts, src/agent/contextMemory/loopEventFold.ts); agent-core-v2 declares immer as a dependency.
  • #2916 switched the extension to the v2 engine, so agent-core-v2 is now bundled into extension.js.
  • apps/vscode/tsdown.config.ts externalizes package.json dependencies by default and only force-bundles @moonshot-ai/* and zod, so immer stays a bare import in the extension bundle.

Suggested fix

Add immer to alwaysBundle in apps/vscode/tsdown.config.ts:

alwaysBundle: [/^@moonshot-ai\//, "zod", "immer"],

With that one-line change, build + package:platform succeed locally (all platform targets verified).

Worth checking whether CI exercises package:platform on main — the 0.7.2 release presumably packaged from a state before this combination, so a release cut from current main may hit this.

Contributor guide

Open the contributing guide

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 apps/vscode/tsdown.config.ts and inspect how alwaysBundle handles package dependencies; then run pnpm -C apps/vscode run build && pnpm -C apps/vscode run package:platform. Confirm that scripts/vsix-verify.mjs accepts every platform package and that extension/dist/extension.js no longer contains a bare immer import.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
build-system, devtools
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.