bitcoinjs / tiny-secp256k1

A tiny secp256k1 native/JS wrapper
MIT License
86 stars 55 forks source link

Nestjs ERROR Error: ENOENT: no such file or directory, open '/var/task/node_modules/tiny-secp256k1/lib/secp256k1.wasm' #122

Open Demiduska opened 1 year ago

Demiduska commented 1 year ago

It's working locally, but when I try to deploy at Vercel and go to the homepage of the app I get a 500 error and this text in the the logs:

2023-07-17T08:26:03.211Z undefined ERROR Error: ENOENT: no such file or directory, open '/var/task/node_modules/tiny-secp256k1/lib/secp256k1.wasm' at Object.openSync (node:fs:601:3) at readFileSync (node:fs:469:35) at Object. (/var/task/node_modules/tiny-secp256k1/lib/cjs/wasm_loader.cjs:7:38) at Module._compile (node:internal/modules/cjs/loader:1254:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Function.Module._load (node:internal/modules/cjs/loader:958:12) at Module.require (node:internal/modules/cjs/loader:1141:19) at Module.Hook._require.Module.require (/var/task/___vc/chunk-5HYM2HUI.js:2143:44) at require (node:internal/modules/cjs/helpers:110:18) { errno: -2, syscall: 'open', code: 'ENOENT', path: '/var/task/node_modules/tiny-secp256k1/lib/secp256k1.wasm' } RequestId: c970c88a-815a-4299-96ba-86b2b3cc3a69 Error: Runtime exited with error: exit status 1 Runtime.ExitError

Demiduska commented 1 year ago

The problem solving by replacing this package: https://github.com/bitcoinerlab/secp256k1. I'm thinking the problem in paths, here was the same problem: https://github.com/microsoft/playwright/issues/5862

AryanJ-NYC commented 7 months ago

Related to: https://github.com/bitcoinjs/tiny-secp256k1/issues/116

IroncladDev commented 6 days ago

I had the same issue when I deployed a Next.js application to Vercel.

Switching to the alternate library by bitcoinerlab worked awesome