Open TurningTide opened 2 weeks ago
Hey @TurningTide,
This likely relates to how you are bundling WebTorrent, as I've never experienced this issue before when bundling the library.
It would be recommended for you to use import WebTorrent from 'webtorrent/dist/webtorrent.min.js'
, rather than importing and bundling the package locally due to all the polyfills required to bundle the app.
What version of this package are you using? ^2.5.1. I use it on server with NestJS
What operating system, Node.js, and npm version? Windows 11, Node 20.18/22.8, npm 10.8.
What happened? When i use
let client = new WebTorrent();
anywhere in my code, app boot fails withThis prevents me from using the WebTorrent client, as the whole app crashes.
What did you expect to happen? I expected the WebTorrent client to be created and the app to run successfully, not crash entirely.
Are you willing to submit a pull request to fix this bug? I tried manually setting the exports in create-torrent's package.json, but encountered the same error in another dependency afterward.