Describe the bug
Here's my webpack.config.ts : https://gist.github.com/yovanoc/cd86b8f226f45dfb465d2c2d9474862c
What is the current behavior?
This error happen on build:
$ webpack --config webpack.config.ts
⬢ webpack: TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received type undefined
at validateString (internal/validators.js:118:11)
at Module.require (internal/modules/cjs/loader.js:1016:3)
at require (/Users/devchris/Documents/code/nodejs/project/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at /Users/devchris/Documents/code/nodejs/project/packages/cli/node_modules/webpack-cli/lib/groups/config.js:60:39
at Array.forEach (<anonymous>)
at ConfigGroup.requireConfig (/Users/devchris/Documents/code/nodejs/project/packages/cli/node_modules/webpack-cli/lib/groups/config.js:59:33)
at ConfigGroup.resolveConfigFiles (/Users/devchris/Documents/code/nodejs/project/packages/cli/node_modules/webpack-cli/lib/groups/config.js:128:41)
at ConfigGroup.run (/Users/devchris/Documents/code/nodejs/project/packages/cli/node_modules/webpack-cli/lib/groups/config.js:177:20)
at /Users/devchris/Documents/code/nodejs/project/packages/cli/node_modules/webpack-cli/lib/webpack-cli.js:102:63
at Array.map (<anonymous>) {
code: 'ERR_INVALID_ARG_TYPE'
}
Additional context
"webpack": "^5.0.0-beta.7",
"webpack-cli": "^4.0.0-beta.1",
@yovanoc provide a minimum reproducible repository to help us dig in the issue.
Ok, I will try to do that asap
just a yarn build here https://github.com/yovanoc/webpack-issue
You need to use ts-node if you want to provide a TypeScript file to webpack. By default webpack doesn't understand TypeScript. You have to give webpack a configuration file that webpack is able to understand.
This is not an issue related to webpack.
I have it in globals. But same, even if I put it in the project it doesn't work either.
PS: I've updated the repo too.
@yovanoc I haven't checked your repository yet, but #1144 might be related to your issue.
See if it solves your issue.
Nope, nothing fix this issue. I already read https://webpack.js.org/configuration/configuration-languages/#typescript
I think the issue is related to node13 and/or these modules versions together. Because just stay in the version ^3.3.10 all working as expected.
I saw the repo. I you have to start ts-node BEFORE running webapck. Having it inside the deps doesn't mean it is used.
(I never used typescript webapck configuration so I might be wrong)
You're wrong. Look at the webpack website. And read my previous message, the version 3.3.10 is working perfectly.
Great thanks!
Did this issue not be resolved?
Not yet
ok.🙂
Hope it will be tackled one day 👍
Should we rename this issue to "webpack-cli 4.x doesn't work with a TypeScript config file"?
Yeah, sounds clearer
This is now fixed
4.0.0-beta.2 can still get this problem.
where is the fix commit?
This is now fixed
Most helpful comment
Hope it will be tackled one day 👍