bolt11 icon indicating copy to clipboard operation
bolt11 copied to clipboard

Runkit.com: Error: Cannot find module 'secp256k1'

Open Overtorment opened this issue 4 years ago • 5 comments

A bit weird I can use bitcoinjs-lib on runkit with no issues

Error: Cannot find module 'secp256k1'
Require stack:
- /app/available_modules/1617109044000/bolt11/payreq.js
- /app/index.js
at Module._resolveFilename in core node:internal/modules/cjs/loader — line 924
at Module._load in core node:internal/modules/cjs/loader — line 769
at Module.require in core node:internal/modules/cjs/loader — line 996
at require in core node:internal/modules/cjs/helpers — line 92
 in bolt11/payreq.js — line 5

image

Overtorment avatar Mar 30 '21 13:03 Overtorment

Yeah... this is a problem with node-secp256k1... sigh

junderw avatar Mar 30 '21 15:03 junderw

whats the problem exactly? something on runkit's side..? is it possible to force bitcoinjs to use purejs EC? i mean, we do it somehow in bluewallet, but i forgot how exactly i wired this in bw :-/

Overtorment avatar Apr 02 '21 11:04 Overtorment

runkit is wonky.

if you install it without build tools it falls back to JS.

junderw avatar Apr 02 '21 17:04 junderw

@Overtorment there is this PR https://github.com/bitcoinjs/tiny-secp256k1/pull/69 If we expose recover() in tiny-secp256k1, then bolt11 can use tiny-secp256k1 (instead of secp256k1)

However I am blocked, is there anyone with Rust skills that could give a hand..?

motorina0 avatar Jan 13 '22 17:01 motorina0

@Overtorment this PR https://github.com/bitcoinjs/bolt11/pull/54 should fix your issue

motorina0 avatar Jan 22 '22 11:01 motorina0