Skip to content

Commit 6b72db1

Browse files
interacseanclaude
andauthored
chore: enforce Node 24 for local dev (#345)
The vite-plugin build (`tsdown`) fails on Node < 24 with `Failed to import module "unrun"`. tsdown 0.22.0 selects its config-file loader at runtime: Node 24 exposes native TS stripping (`process.features.typescript`), so it uses the "native" loader; on older Node it falls back to "unrun", which tsdown does not declare as a dependency. CI runs on Node 24 (engines.node: "24.x") so it passes there; only local dev on Node 22 broke. Align local dev with the already-declared/CI Node version rather than working around it: - Add .nvmrc (24) so `nvm use`/`nvm install` selects the right version. - Set engineStrict: true in pnpm-workspace.yaml so `pnpm install` fails fast with a clear ERR_PNPM_UNSUPPORTED_ENGINE message instead of the cryptic downstream `unrun` error. (pnpm 11 reads config from pnpm-workspace.yaml in this repo, matching the existing camelCase keys.) - Document the Node 24 prerequisite in README. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7ffdd9c commit 6b72db1

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ For users building applications with AppShell, see the detailed guides in `docs/
3131

3232
This project is a monorepo managed with pnpm.
3333

34+
### Prerequisites
35+
36+
This project requires **Node.js 24** (see `engines` in `package.json`; CI runs on Node 24). Some build tooling (`tsdown`) relies on Node 24's native TypeScript config loading — on older versions it falls back to a loader that isn't installed, and the build fails. `engine-strict` is enabled, so `pnpm install` will refuse to run on an unsupported version.
37+
38+
If you use [nvm](https://github.com/nvm-sh/nvm), a `.nvmrc` is provided:
39+
40+
```bash
41+
nvm use # or: nvm install
42+
```
43+
3444
### Setup
3545

3646
```bash

pnpm-workspace.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,10 @@ trustPolicyExclude:
7979

8080
# Save exact versions when adding dependencies
8181
saveExact: true
82+
83+
# Enforce the Node version declared in package.json `engines` (24.x).
84+
# Without this, pnpm only warns on Node < 24 and the install proceeds,
85+
# leading to a cryptic build failure: tsdown's config loader needs Node 24's
86+
# native TypeScript stripping and otherwise falls back to `unrun` (not a
87+
# tsdown dependency). Fail fast at install time instead. See README "Development".
88+
engineStrict: true

0 commit comments

Comments
 (0)