Could not build webpack.config.ts at 5.60.0 with webpack-dev-server.
See original GitHub issueBug report
What is the current behavior?
At webpack 5.60.0, webpack.config.ts
cannot be compiled and builded when property of webpack-dev-server
is existed.
If the current behavior is a bug, please provide the steps to reproduce.
In my webpack.config.ts
, there is a property devServer
because I use webpack-dev-server
.
like:
import webpack from "webpack"
import type { Configuration } from "webpack-dev-server"
const devServer: Configuration = {
static: {
directory: path.resolve(__dirname, "/dist"),
},
historyApiFallback: true,
open: true,
port: 8000,
hot: true,
proxy: {
"/api": "http://localhost:8080",
},
}
const config: webpack.Configuration = {
// Omit lines //
devServer: devServer,
}
When I upgraded webpack from 5.59.1 to 5.60.0, tsc errors on the property that shows:
Object literal may only specify known properties, and 'devServer' does not exist in type 'Configuration'.
What is the expected behavior?
At webpack 5.59.1, webpack.config.ts
is correctly builded, but at webpack 5.60.0 is not.
Other relevant information:
webpack version: 5.60.0
Node.js version: v14.18.1
Operating System: any
Additional tools: webpack-dev-server@4.3.1
, @types/webpack-dev-server@4.3.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Configuration error in webpack-dev-server v4 2022
Dev Server has been initialized using an options object that does not match the API schema. - options has an unknown property 'contentBase'....
Read more >Configuration Languages - webpack
If the module in compilerOptions in tsconfig.json is commonjs , the setting is complete, else webpack will fail with an error. This occurs...
Read more >@angular-builders/custom-webpack - npm
This option defines your custom webpack configuration. If not specified at all, plain Angular build will run.
Read more >How I solved and debugged my Webpack issue through trial ...
Debugging webpack config is usually a cumbersome task: the best way to go about it is to create a config from a scratch....
Read more >Using webpack with TypeScript - LogRocket Blog
Learn how to use webpack to compile TypeScript to JavaScript and bundle source ... By default, webpack does not need a configuration file....
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 FreeTop 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
Top GitHub Comments
Don’t worry, all is fine
I recognized this error was occurred by yarn’s cache when I make reproducible example. So, after I do
yarn cache clean
, the error was solved. This is all of my fault, sorry for taking time for me…Edit: error was caused by
yarn.lock
. Removing and Regenerating it solved this error completely.