CKB Pulse

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

Prefer
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.

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)

More about Developer tooling

All 35 in this topic

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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.