-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS type for Entry error #11063
Comments
You could try that: -entry: ['webpack-hot-middleware/client', path.join(__dirname, '..', 'client', 'index.jsx')],
+entry: ['webpack-hot-middleware/client', path.join(__dirname, '..', 'client', 'index.jsx')] as const, |
Answer above |
I did try that, didn't work. For now I just have to @ts-ignore the line because it doesn't like the typing of [string, ...string[]]. |
/cc @sokra I think it is bug, here infromation microsoft/TypeScript#30798 |
Can I work on this issue? |
Yes, PR welcome |
How do I reproduce the bug and where are the changes supposed to be made? |
Example above |
We can workaround that problem omitting See webpack/tooling repo |
I created a simple webpack project with the documentation here https://webpack.js.org/guides/getting-started/ and copied and pasted the code above. I don't understand where the code for the type entry is supposed to be. i could not reproduce the bug with |
Also having a similar issue. I'm defining an entry in a variable: const entry: Record<string, string[]> = {
foo: ['bar', 'baz']
} But when I supply this to configuration, get the following:
|
Bug report
What is the current behavior?
Typing error with the following:
The typing for Entry:
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
The code works fine, the typing shouldn't be throwing an error for something that is valid. It seems the last part of the typing should just be
string[]
, which works fine if I adjust it manually.Other relevant information:
webpack version: webpack 5 beta 18
Node.js version: 12
Operating System: macos
Additional tools: vscode
The text was updated successfully, but these errors were encountered: