bytenode-webpack-plugin
bytenode-webpack-plugin copied to clipboard
Add `webpack v5` support
Hello, I am trying to package and use webpack5, but it is returning the following error:
[webpack-cli] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
at new NodeError (node:internal/errors:363:5)
at validateString (node:internal/validators:119:11)
at Object.isAbsolute (node:path:403:5)
at isDependency (C:\ProjetosSSD\SlayderGames\Launcher\Patcher\node_modules\@herberttn\bytenode-webpack-plugin\lib\index.js:241:28)
at C:\ProjetosSSD\SlayderGames\Launcher\Patcher\node_modules\@herberttn\bytenode-webpack-plugin\lib\index.js:210:28
at Array.map (<anonymous>)
at prepare (C:\ProjetosSSD\SlayderGames\Launcher\Patcher\node_modules\@herberttn\bytenode-webpack-plugin\lib\index.js:209:37)
at C:\ProjetosSSD\SlayderGames\Launcher\Patcher\node_modules\@herberttn\bytenode-webpack-plugin\lib\index.js:154:27
at Array.map (<anonymous>)
at BytenodeWebpackPlugin.preprocessEntry (C:\ProjetosSSD\SlayderGames\Launcher\Patcher\node_modules\@herberttn\bytenode-webpack-plugin\lib\index.js:153:24) {
code: 'ERR_INVALID_ARG_TYPE'
}
const { merge } = require('webpack-merge')
const BytenodeWebpackPlugin = require('@herberttn/bytenode-webpack-plugin').BytenodeWebpackPlugin
const common = require('./webpack.common.js')
module.exports = merge(common, {
mode: 'production',
plugins: [new BytenodeWebpackPlugin()],
})
*Just putting a note, this plugin is sensational, congratulations to the developers.
Hello @rospirski! Thank you for the interest! I was really busy finishing another project, sorry for the delay.
Currently this plugin does not really support Webpack v5, we still need to adapt the code to the new hooks and test it. I haven't had time to do it, yet.
Feel free to try if your need is time sensitive! I'll happily take contributions! If not, I'll write here again when I eventually do it.
Unfortunately I tried and I couldn't get it to work on the webpack, I had problems creating a virtual asset for the file loader, but without success.
I would appreciate it very much when I manage to make the webpack5 version.
Hopefully this gets updated to support Webpack v5...I tried using it for our project and same error.
There is a pull request that you can test and help improve so we can get Webpack5 support:
https://github.com/herberttn/bytenode-webpack-plugin/pull/7
A year later, I got the same error, is there any plan to support webpack5?
An unhandled exception occurred: The "path" argument must be of type string. Received an instance of Object
@hanwangqyq it's open source. I don't think @herberttn has any current plan to work on Webpack 5 support. If you have time to contribute to https://github.com/herberttn/bytenode-webpack-plugin/pull/7. Feel free to fork my WIP branch. IIRC the critical thing that still needs doing is using the proper webpack hook to call bytenode.
https://github.com/herberttn/bytenode-webpack-plugin/releases/tag/v2.0.0