I´m currently trying to make the lib youtube-dl-exec work in my electron application. The problem here is that it's not intended to run in the browser!
From what I learned since I tried to solve this issue is that Webpack 5 does no longer provide auto-polyfill, which might be part of the issue I´m facing. To overcome this situation I already tried many solutions I´ve found, but for now they only reduced the list of errors.
My Setup
What I did so far?
Installed this plugin: node-polyfill-webpack
added in my webpack.config.base.js:
resolve: {
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
modules: [webpackPaths.srcPath, 'node_modules'],
fallback: {
"fs": false, //added to fix issue
"child_process": false, //added to fix issue
}
},
plugins: [
new NodePolyfillPlugin(), //added to fix issue
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
}),
],
};
This reduce the error from a lot to two errors:
I already searched a lot but haven't found anything that could help me. I´m aware of a possible duplicate, but this Question is in my opinion poorly asked and not answered yet.