Now that webpack v4-beta.0 has been released, there are no more expected breaking changes before the v4 full release in a few weeks. It would be great to publish a version of webpack-dev-server that aims to add support for this new version so folks can start to test their stuff.
I found https://github.com/webpack/webpack-dev-server/pull/1243 which could be a good start for this, but I figured I'd open an issue for folks to track if they are interested in this in general.
I've been caught twice now trying to upgrade Webpack during late beta and getting through the config changes only to realize that it was a waste of time since webpack-dev-server wasn't yet supported. This happened to me on v1 -> v2 and now v3 -> v4.
I have a question if the serious developers are not using dev-server in their big projects because I can't see how it would be ideal to do a final beta when the two haven't yet been tested together to see if there are unforeseen limitations. The dev-server isn't as first class as I'd like. I guess that for now I'll just set this code aside, rollback, remove npm links. Its annoying.
I鈥檓 having an issue with code-splitting in v4-beta + WDS (in addition to the fun yargs issue mentioned).
Code-splitting is trying to load chunks relatively from the path it鈥檚 on, rather than absolutely from the root. E.g., if you鈥檙e on /pages/about, the chunk is 404-ing trying to load from /pages/1.js rather than /1.js like v3 did.
Not sure if this is a WDS issue or a webpack v4 issue.
Example here: https://github.com/dangodev/webpack-v4-code-splitting-test
@dangodev This was just posted a few hours ago, it might be related: https://medium.com/webpack/webpack-4-import-and-commonjs-d619d626b655
@damonbauer nice! Just read through that. That鈥檚 helpful info, but I don鈥檛 think that鈥檚 affecting this issue.
I opened an issue on the core repo. I鈥檓 thinking now it鈥檚 a webpack thing, not a webpack-dev-server thing.
Please test the latest beta, [email protected]. Also be sure to read the changelog.
@SpaceK33z when passing arguments via CLI (e.g., "start": "webpack-dev-server --hot"), it seems to require installing webpack-cli for yargs. Is this intentional, or a bug?
It intentionally requires webpack-cli, yes.
Found couple of issues with the new defaults in Webpack 4.
Versions:
Config:
var config = {
mode: "development",
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader",
},
],
},
};
As the entry is not defined following error is thrown:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry should be one of these:
object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
-> The entry point(s) of the compilation.
Details:
* configuration.entry should be an object.
-> Multiple entry bundles are created. The key is the chunk name. The value can be a string or an array.
* configuration.entry should be a string.
-> An entry point without name. The string is resolved to a module which is loaded upon startup.
* configuration.entry[1] should be a string.
-> A non-empty string
* configuration.entry should be an instance of function
-> A Function returning an entry object, an entry string, an entry array or a promise to these things.
It works if I define it to entry: "./src/index.js" but that should not be required with Webpack 4 as it's the default.
Another related thing is that the bundle should be served from /dist/main.js. It seems that it's not served at all. This can be fixed by setting:
output: {
publicPath: "/dist",
},
But it's useable otherwise. Thank you!
@epeli do you also get this error when you are using webpack instead of webpack-dev-server?
Nope, the weppack command works as expected.
@epeli see #1308 for that error.
I'm going to close this since the latest beta works with webpack v4 now. Let's create separate issues for new problems.
Most helpful comment
I've been caught twice now trying to upgrade Webpack during late beta and getting through the config changes only to realize that it was a waste of time since webpack-dev-server wasn't yet supported. This happened to me on v1 -> v2 and now v3 -> v4.
I have a question if the serious developers are not using dev-server in their big projects because I can't see how it would be ideal to do a final beta when the two haven't yet been tested together to see if there are unforeseen limitations. The dev-server isn't as first class as I'd like. I guess that for now I'll just set this code aside, rollback, remove npm links. Its annoying.