Skip to content

fix(bundle): load every chunk before an upgrade - #448

Merged
leemour merged 1 commit into
mainfrom
fix/upgrade-preloads-chunks
Nov 2, 2026
Merged

leemour merged 1 commit into
mainfrom
fix/upgrade-preloads-chunks

Conversation

@leemour

@leemour leemour commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Task

wa upgrade (0.22.0 → 0.23.0, pnpm) installed the new version, then failed with MODULE_NOT_FOUND.

Why

pnpm's add -g removes the versioned folder the old process was loaded from; the bundle keeps lazy import()s lazy, so a chunk imported after the install no longer exists. A server already preloads every chunk against exactly this (bundle.ts header); upgrade did not.

What

isUpgrade(words) (upgrade among the first two plain words) in the loader: it awaits every chunk before importing the entry. Changelog.

Testing

New bundle.test.ts case (which argv count as an upgrade; the loader carries the check). Full vitest, typecheck, lint, docs:check. Not reproduced end to end: the failure needs a real global pnpm upgrade.

🤖 Generated with Claude Code

@leemour
leemour force-pushed the fix/upgrade-preloads-chunks branch from 3a3c1ba to 74183ff Compare November 2, 2026 03:59
wa upgrade 0.22.0 → 0.23.0 installed the new version and then failed with MODULE_NOT_FOUND: pnpm removes
the folder the running version was loaded from, and the command imported a lazy chunk after the install.
A server already preloads every chunk for the same reason; an upgrade now awaits them before it starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour force-pushed the fix/upgrade-preloads-chunks branch from 74183ff to 4f253f4 Compare November 2, 2026 04:07
@leemour
leemour merged commit bcf74d1 into main Nov 2, 2026
10 checks passed
@leemour leemour mentioned this pull request Nov 2, 2026
leemour added a commit that referenced this pull request Nov 2, 2026
Dates the Unreleased section as 0.75.0: `--full-history` (#447), the
upgrade chunk preload (#448), and a native list's help without `OR`
(#449). Only package.json and the CHANGELOG heading change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant