Skip to content

fix(wallet): self-contained build (drop the lightnode-sdk dependency)#78

Merged
marinom2 merged 1 commit into
mainfrom
fix/wallet-standalone-no-sdk-dep
Jun 10, 2026
Merged

fix(wallet): self-contained build (drop the lightnode-sdk dependency)#78
marinom2 merged 1 commit into
mainfrom
fix/wallet-standalone-no-sdk-dep

Conversation

@marinom2

Copy link
Copy Markdown
Owner

Fixes the fresh-clone build failure for real this time.

Root cause (deeper than #77): the wallet imported WorkerOperator/NETWORKS from lightnode-sdk via file:../sdk, which forced building the SDK (tsc) before bundling. That SDK build needs the monorepo's hoisted @types/node and fails in a clean wallet-only checkout (Cannot find name 'process', Cannot find module 'node:crypto'), so a fresh clone could not build the extension - even with the prebuild from #77.

Fix: inline the four worker-status reads with viem (src/rpc/worker.ts) against the LightChain mainnet worker contracts - the only thing the wallet used the SDK for - and remove the dependency plus the prebuild/build:sdk/predev scripts. The wallet now builds from its own deps with no SDK, no prebuild, no dist.

Verified on a true fresh clone: git clone … && cd wallet && npm install && npm run build succeeds. Bundle drops 918 → 581 kB. 24 wallet tests + 491 root tests green, tsc clean.

…pendency)

The wallet imported WorkerOperator/NETWORKS from lightnode-sdk via file:../sdk,
which forced building the SDK (tsc) before bundling. That SDK build needs the
monorepo's hoisted @types/node and fails in a clean wallet-only checkout
(Cannot find name process / module node:crypto), so a fresh clone could not
build the extension at all.

Inline the four worker-status reads with viem (src/rpc/worker.ts) against the
LightChain mainnet worker contracts - the only thing the wallet used the SDK
for - and remove the dependency plus the prebuild/build:sdk/predev scripts. The
wallet now builds from its own deps with no SDK, no prebuild, no dist. Bundle
drops 918 -> 581 kB.
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lightnode Ready Ready Preview, Comment Jun 10, 2026 8:52pm

Request Review

@marinom2 marinom2 merged commit 525ddc1 into main Jun 10, 2026
5 checks passed
@marinom2 marinom2 deleted the fix/wallet-standalone-no-sdk-dep branch June 10, 2026 20:55
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