Code Monkey home page Code Monkey logo

Comments (5)

junderw avatar junderw commented on June 12, 2024

Can you provide detailed repro steps?

from tiny-secp256k1.

junderw avatar junderw commented on June 12, 2024

I think this is a browser error... but that file is not used in browsers.

wasm_loader.browser.ts is for browsers.

Either:

  1. It's an error in whatever bundler you used.
  2. Maybe there's some weird edge case in NodeJS... in which case I need better repro steps.

from tiny-secp256k1.

motorina0 avatar motorina0 commented on June 12, 2024
  1. It's an error in whatever bundler you used.

It is an Electron app that uses the lib, it might be the bundler. I will have a more in detail look. Thank you for the hint.

from tiny-secp256k1.

pxr64 avatar pxr64 commented on June 12, 2024

Facing the same issue.

I ended up creating a fork and updating the browser loader.
src_ts
/wasm_loader.browser.ts

// Suppress TS2792: Cannot find module './secp256k1.wasm'.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import wasm from "./secp256k1.wasm";

import * as rand from "./rand.js";
import * as validate_error from "./validate_error.js";
const imports = {
    "./rand.js": rand,
    "./validate_error.js": validate_error,
};
const mod = await WebAssembly.compile(Buffer.from(wasm.split(',')[1], 'base64'));
const instance = await WebAssembly.instantiate(mod, imports);

export default instance.exports;

from tiny-secp256k1.

Taha-daboussi avatar Taha-daboussi commented on June 12, 2024

hey @motorina0 ,
I know it's been long time since this issue was opened , just checking if you was able to solve this error

from tiny-secp256k1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.