Dependencies with Webpack 3.x
Closed this issue · 14 comments
There are a few dependencies that don't appear to be compatible with webpack 3.x and throw warnings when I run yarn start
. If I run yarn check
I get the following:
error "babel-loader#webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc" doesn't satisfy found match of "webpack@3.0.0"
error "extract-css-chunks-webpack-plugin#webpack@^2.2.0" doesn't satisfy found match of "webpack@3.0.0"
error "stats-webpack-plugin#webpack@^1.0||^2.1.0-beta||^2.2.0-rc" doesn't satisfy found match of "webpack@3.0.0"
Cool. Why not try upgrading them and supplying a PR?
Sure, I can work on it. Upgrading babel-loader to 7.1.x should be okay, but I wasn't sure how you wanted to handle extract-css-chunks-webpack-plugin and stats-webpack-plugin that have peer dependencies < webpack@^3.0.0.
i made ECCWP. so i will just change the peer deps. ...stats plugin, there's not much we can do about it besides bug them.
Re: stats-webpack-plugin - Looks like there's an open PR to add Webpack 3 support, though a comment mentions using webpack-stats-plugin as an alternative. Have you considered that in the past?
I have. It just has additional things I haven't needed. I haven't needed to serve the stats for example.
At the end of the day I personally am not a big stickler for warnings. They're inevitable and a time-sink to worry about. I say we just wait until that PR is merged.
Part of my problem at the moment is that the project doesn't build successfully and it seems like it may be related to extract-css-chunks-webpack-plugin. I see a bunch of errors like the following for each CSS file:
ERROR in ./src/css/App.css
edux-first-router-demoError: Can't resolve 'C:clones
ode_modulesextract-css-chunks-webpack-pluginhotModuleReplacement.js' in 'C:\clones\redux-first-router-demo\src\css'
It's odd that the slashes have been removed from the paths. Could this be a Windows-only issue?
That plugin had one other person errors reporting on windows. That's the real problem you're having. Let's forget about the warnings and try to solve this. We need it to work on windows. I don't have windows and am pretty secluded right now so don't have access to a windows computer.
I added cross-env a while back and that fixed some of the errors as @nicolasdelfino reported. But there's still at least one more. The problem is precisely here:
https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/blob/master/loader.js#L142
For whatever reason the way I require that file isn't working on windows. Honestly I haven't even done the basic googling to solve it.
Your error is clearly missing the flashes, e.g. between node_modules
and extract-css...
, etc.
...from a quick google, it seems loaderUtils.stringifyRequest
is supposed to handle this:
https://github.com/webpack/loader-utils#stringifyrequest
and path.join
should just be working:
https://stackoverflow.com/questions/31847712/node-js-fs-module-and-windows-paths
...perhaps there's a better way to do __dirname
. Webpack creates that variable for you, so without specifying additional webpack config options that use the native node __dirname
, it's created by webpack. Perhaps webpack recommends another way to refer to __dirname within packages.
u know what, try getting rid of the __dirname. i bet that solves it. ...just open node_modules/extract-css-chunks-webpack-plugin/loader.js
and manually make the change to see if it works.
and i guess even get rid of path.join
. u may only need the filename since it's in the same directory and since loaderUtils.stringifyRequest
's purpose is dealing with relative paths.
Very strange. For whatever reason, Yarn installed version 1.0.15
of extract-css-chunks-webpack-plugin, despite it being set to latest
in package.json
. Running yarn upgrade extract-css-chunks-webpack-plugin
installed the correct latest version (2.0.7
). Not sure I understand why that version got installed, but it compiled successfully following that. Sorry for the confusion.
Even on windows? That's weird. I would expect that issue to still occur. Either way, that's good to know.
ok, I updated extract-css-chunks-webpack-plugin to have a peerDep of * for webpack. and i did the babel-loader update u mentioned. so im closing this since it's all we can do.
also by the way the autodll plugin had broken HMR. i fixed it, so HMR works again. the package also has the codesandbox styles + few other small fixes.