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

Wrong path when bundling tiny-secp256k1 with Electron

Open electic opened this issue 2 years ago • 1 comments

Hello,

First off thank you for making this library. Secondly, we are having issues bundling this with Electron and Electron Builder. The issue is that during the bundling process the following file:

wasm_path.js uses import.meta.url.

Using webpack, when it is packaged and built, it uses the path of the wasm file on the build machine. Instead of the where it is relative to where it running on the target machine. Disabling that behavior in webpack using:

 module: {
        parser: {
            javascript : { importMeta: false }
        }
    }

Does not seem to work because it then throws another error that import.meta.url cannot be used outside of a module. I have a feeling others will run into this issue. For now, we have copied the wasm file out and patched the file to look for it relative to the installation path. Any help here appreciated. Happy to help debug.

electic avatar Oct 06 '22 20:10 electic

@electic, I believe I am running into the same issue you are. Is it possible for you to share a redacted version of your solution?

iknowhtml avatar Apr 20 '23 17:04 iknowhtml