v3-client icon indicating copy to clipboard operation
v3-client copied to clipboard

Cannot Convert to Browser-Side JS

Open maxholloway opened this issue 3 years ago • 1 comments

Error

Hello, I am trying to use the browserify package in order to use the v3-client in the client. When I run browserify <my-file.js> -o bundle.js I get the following error:

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/maxwellholloway/Desktop/example/worker_threads'
    required by /Users/maxwellholloway/Desktop/example/node_modules/@dydxprotocol/starkex-lib/build/src/signable/index.js

This error does not appear when I run browserify on other packages.

System

System: Mac OS 10.15.7 Node: v17.3.0 npm: 8.3.0

Full Replication Steps

cd ~/Desktop
mkdir example && cd example
npm init -y
npm install @dydxprotocol/v3-client
npm install -g browserify
echo "const { DydxClient } = require('@dydxprotocol/v3-client')" > main.js
browserify main.js -o bundle.js

maxholloway avatar Jan 09 '22 17:01 maxholloway

I don't think anybody will support this - I belive it is beyond scope of project itself. However I encounter similar problem and was able to generate bundle with webpack5.

Did you succeed to generate it with browserify? Please mind my experience with JS for Web is count in just one dozen of hours. I am planning to use it with my C++ app with embeded JsEngine.

https://github.com/3electrons/dydx-v3-client-webpack

3electrons avatar May 18 '22 15:05 3electrons