Open Prof1-web opened 1 month ago
It's actual only for version > 2. I tried 1.9.7 and it works perfectly. This problem is not only with electron. This problem occurs even if you do not use any other libraries except webtorrent. Since version 2, no package builder can work with webtorrent when building for node.js. I tried Webpack, browserify, esbuild, Vite, Percel. The problem is not in the configuration files. Any other libraries are built perfectly by any of the above builders. Please fix this. Or give the ability to use require so that you can skip the build step.
this is strictly an issue with your build config, not webtorrent, I've used webtorrent on multiple electron projects, and a few other electron projects also use webtorrent without issue, you could always exclude node data channel if you want to patch this rapidly
this is strictly an issue with your build config, not webtorrent, I've used webtorrent on multiple electron projects, and a few other electron projects also use webtorrent without issue, you could always exclude node data channel if you want to patch this rapidly
Can you give me config example for node.js? (Not browser)
node index.js
node requires no custom module resolution
node index.js
node requires no custom module resolution
But you can't use require () with webtorrent without builders
What version of this package are you using? Latest
What operating system, Node.js, and npm version? Node 20 with yarn, tried mac os and windows
What happened? I have an app with electron forge, webtorrent and webpack. I created it using 2 commands:
Add import to main.js
And:
After this my application only works on my computer because after the build there is an absolute path in the application code:
I don't understand why this is happening. If I remove the webtorrent import from my main.js, the absolute path disappears from the build. I know that webtorrent requires additional configuration for webpack. But it seems this is only required when used in a browser? Problem is only with webtorrent, other libs work perferctly. I tried different versions of webtorrent. It didn't help me.
My webpack.main.config.js (default for electron forge):
webpack.rules.js (default for electron forge)
And forge.config.js (default for electron forge):