Skip to content

chore: pin @emnapi/* as optional deps to fix npm ci#7

Merged
kevinccbsg merged 1 commit intomainfrom
chore/emnapi-optional-deps
Apr 29, 2026
Merged

chore: pin @emnapi/* as optional deps to fix npm ci#7
kevinccbsg merged 1 commit intomainfrom
chore/emnapi-optional-deps

Conversation

@kevinccbsg
Copy link
Copy Markdown
Member

Summary

Adds @emnapi/core and @emnapi/runtime as optionalDependencies to work around the npm lockfile-sync bug triggered by Tailwind 4 + Vite 8 (rolldown).

Why

Two transitive paths in this app pull in @napi-rs/wasm-runtime, which peer-depends on @emnapi/*:

@tailwindcss/vite → @tailwindcss/oxide → oxide-wasm32-wasi → @napi-rs/wasm-runtime
vite → rolldown → @rolldown/binding-wasm32-wasi → @napi-rs/wasm-runtime

npm has a long-standing bug where the lockfile, depending on which platform generated it, omits some of those optional entries. npm ci then fails on a different platform with:

npm error Missing: @emnapi/core@... from lock file
npm error Missing: @emnapi/runtime@... from lock file

Pinning them at the root forces the lockfile to always carry them.

Refs: npm/cli#4828, tailwindlabs/tailwindcss#13654

Test plan

  • npm ci succeeds locally on macOS
  • CI passes
  • Remove this workaround once npm fixes the underlying bug

🤖 Generated with Claude Code

Workaround for the npm optional-deps lockfile bug triggered by
@tailwindcss/oxide-wasm32-wasi and @rolldown/binding-wasm32-wasi
(both pull in @napi-rs/wasm-runtime which peer-depends on @emnapi/*).

Without this, npm ci fails on platform switches (Linux <-> macOS,
arm64 <-> x64) because the lockfile drops the WASM-fallback peer
entries depending on which platform generated it.

Refs: npm/cli#4828

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kevinccbsg kevinccbsg force-pushed the chore/emnapi-optional-deps branch from 88a60de to 1797668 Compare April 29, 2026 22:14
@github-actions
Copy link
Copy Markdown

TWD Contract Validation

Spec Passed Failed Warnings Mode
./contracts/todos-3.0.json 6 0 1 error

6 passed · 0 failed · 1 warnings

View full report →

@kevinccbsg kevinccbsg merged commit 9328b6f into main Apr 29, 2026
1 check passed
@kevinccbsg kevinccbsg deleted the chore/emnapi-optional-deps branch April 29, 2026 22:16
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