tiny-secp256k1 icon indicating copy to clipboard operation
tiny-secp256k1 copied to clipboard

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

Open Demiduska opened this issue 1 year ago • 3 comments

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 avatar Jul 17 '23 08:07 Demiduska

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

Demiduska avatar Jul 17 '23 11:07 Demiduska

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

AryanJ-NYC avatar Dec 06 '23 17:12 AryanJ-NYC

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

Switching to the alternate library by bitcoinerlab worked awesome

IroncladDev avatar Jul 24 '24 21:07 IroncladDev