TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
See original GitHub issueHi, svg-spritemap-webpack-plugin version 3.3.2 isn’t working for me compared to the older version. I’ve tried without path.resolve and same error as well.
My configurations:
new SVGSpritemapPlugin([
path.resolve(__dirname, 'public/images/app/icons/app/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/consumable/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/dance/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/emoji/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/human/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/pet/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/store/*.svg'),
path.resolve(__dirname, 'public/images/app/icons/user/*.svg')
], {
})
Output of npm run compile:
:Psychedelices alizee$ npm run compile
> psychedelices@1.0.0 compile /Users/alizee/Development/GitHub/Psychedelices
> webpack
/Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/cli.js:74
throw err;
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
at validateString (internal/validators.js:107:11)
at Object.normalize (path.js:1003:5)
at module.exports (/Users/alizee/Development/GitHub/Psychedelices/node_modules/svg-spritemap-webpack-plugin/lib/options-formatter.js:19:20)
at new SVGSpritemapPlugin (/Users/alizee/Development/GitHub/Psychedelices/node_modules/svg-spritemap-webpack-plugin/lib/index.js:31:24)
at Object.<anonymous> (/Users/alizee/Development/GitHub/Psychedelices/webpack.config.js:152:9)
at Module._compile (/Users/alizee/Development/GitHub/Psychedelices/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (/Users/alizee/Development/GitHub/Psychedelices/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (/Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/utils/convert-argv.js:115:13)
at requireConfig (/Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/utils/convert-argv.js:117:6)
at /Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/utils/convert-argv.js:124:17
at Array.forEach (<anonymous>)
at module.exports (/Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/utils/convert-argv.js:122:15)
at /Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/cli.js:71:45
at Object.parse (/Users/alizee/Development/GitHub/Psychedelices/node_modules/yargs/yargs.js:567:18)
at /Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack-cli/bin/cli.js:375:3)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:681:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/Users/alizee/Development/GitHub/Psychedelices/node_modules/webpack/bin/webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:774:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
at Module.load (internal/modules/cjs/loader.js:641:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)
at internal/main/run_main_module.js:17:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! psychedelices@1.0.0 compile: `webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the psychedelices@1.0.0 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alizee/.npm/_logs/2019-05-26T00_05_07_903Z-debug.log
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
The "path" argument must be of type string ... - Stack Overflow
I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get...
Read more >[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path ...
Have you run into the error “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined”? In this story I'll go...
Read more >The "path" argument must be of type string. Received - YouTube
JavaScript : TypeError [ERR_INVALID_ARG_TYPE]: The " path " argument must be of type string. Received type undefined raised when starting ...
Read more >Why I got TypeError [ERR_INVALID_ARG_TYPE]: The "path ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null at new NodeError (node:internal/errors:278:15) ...
Read more >typeerror [err_invalid_arg_type]: the "path" argument must be ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined at Object.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@maltheism, a fix for this bug has been released in version
3.3.3
🚀@maltheism, I’ve just pushed a fix to master. Could you check if that works for you?