All lessons · Developer tooling · Start here · Glossary
Pass wasm bytes to ckb-vm-js createVerifier in NodeWorkingChecked by the owner
Checked by the owner · Check: right · Checked 2026-11-19
In Node, calling ckb-vm-js createVerifier() with no arguments fails with "fetch failed" because it cannot fetch its .wasm from a file URL. Read the bytes from the package's ckb-vm-js/wasm export (via import.meta.resolve and readFile) and pass them as createVerifier({ wasm }).
Why it matters: Without the bytes, a Node service that relies on the default ckb-vm-js verifier fails at startup with "fetch failed", and tests that inject their own verifier never catch it.
New Node loading detail for ckb-vm-js wasm.
Pattern
return ckbVmJs({ verifier: await vmjs.createVerifier({ wasm }), rpcUrl });Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- LusoCryptoLabs/ckb-ward:
tests/bind-server.test.ts
- Concepts
- Testing and devnet
- Evidence
- Checked by the owner: checked by the owner of the project it came from, who is also the publisher of these lessons
- First seen
- 2026-11-17
- Last changed
- 2026-11-17
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-11-17 · LusoCryptoLabs/ckb-ward · more from this project
More about Developer tooling
- ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the field
- Derive devnet Spore and system script cell deps from a fresh OffCKB export
- Saved transaction test vectors go stale when their cell deps are spent
Checked by @LusoCryptoLabs (owner of the project), 2026-11-19.
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Pass wasm bytes to ckb-vm-js createVerifier in Node", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/pass-wasm-bytes-to-ckb-vm-js-createverifier-in-node, CC BY 4.0, last changed 2026-11-17.