Skip to content

Error when building with Webpack v5 #3

@vasartam

Description

@vasartam

Hi!

I'm using Webpack v5 in my project. While installing this library, encountered some errors:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: mypackage@0.2.0
npm ERR! Found: webpack@5.66.0
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^5.64.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.42.1" from @visto9259/php-webpack-plugin@1.0.1
npm ERR! node_modules/@visto9259/php-webpack-plugin
npm ERR!   dev @visto9259/php-webpack-plugin@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/myuser/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/myuser/.npm/_logs/2022-01-16T12_59_09_182Z-debug.log

(The name of my package is replaced with "mypackage", the name of my user is replaced with "myuser")

I'm guessing this problem comes from the fact that this plugin should be used with Webpack v4.

After installing the library with --legacy-peer-deps flag and continuing with installation instructions, this is what I met after invoking a build process:

[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:371:5)
    at validateString (node:internal/validators:120:11)
    at Object.join (node:path:1172:7)
    at /var/www/mypackage.loc/wp-content/themes/mypackage/node_modules/@visto9259/php-webpack-plugin/index.js:32:38
    at Array.forEach (<anonymous>)
    at /var/www/mypackage.loc/wp-content/themes/mypackage/node_modules/@visto9259/php-webpack-plugin/index.js:31:24
    at Array.forEach (<anonymous>)
    at genPHPOutputAssocArray (/var/www/mypackage.loc/wp-content/themes/mypackage/node_modules/@visto9259/php-webpack-plugin/index.js:27:25)
    at /var/www/mypackage.loc/wp-content/themes/mypackage/node_modules/@visto9259/php-webpack-plugin/index.js:74:28
    at Hook.eval [as callAsync] (eval at create (/var/www/mypackage.loc/wp-content/themes/mypackage/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1) {
  code: 'ERR_INVALID_ARG_TYPE'
}

I just wanted to try out this library, but since it doesn't work, I guess I will search for alternatives. Would be nice if the compatibility with Webpack v5 would be fixed, if this project is maintained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions