johnagan / crx-webpack-plugin

A webpack plugin to package chrome extensions (crx) post build
MIT License
25 stars 23 forks source link

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined #22

Open KR1470R opened 1 year ago

KR1470R commented 1 year ago

included this plugin into my project by this way:

const CRX = require("crx-webpack-plugin");
module.exports = {
    ...
    plugins: [
        new CRX({
              contentPath: "./src/recorder_extension",
              outputPath: "./dist/recorder_extension",
              name: "recorder",
         }),
    ],
    ...
}

and getting the error when trying to build my project:

[webpack-cli] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:162:11)
    at Object.isAbsolute (node:path:1157:5)
    at new Plugin (..../node_modules/crx-webpack-plugin/index.js:21:23)
    at Object.<anonymous> (..../webpack.config.js:52:5)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
    at Module.load (node:internal/modules/cjs/loader:1033:32)
    at Function.Module._load (node:internal/modules/cjs/loader:868:12)
    at Module.require (node:internal/modules/cjs/loader:1057:19) {
  code: 'ERR_INVALID_ARG_TYPE'
}

any ideas what went wrong? thanks.

versions:

"webpack": "^5.79.0",
"webpack-cli": "^5.0.1"
KR1470R commented 1 year ago

it seems like crx-webpack-plugin should be updated for the last webpack version.