-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cannot resolve 'file' or 'directory' ../../webpack-stats.json on first build #60
Comments
Yes, this is a known issue. Suggestions to fix it are welcome. I don't really want to have an empty In production it's not that big of a problem, at least in my experience of deploying the heroku branch, as you end up having |
also shouldn't const stats = require('../../webpack-stats.json');
if (__CLIENT__) {
return require('./InfoBar.scss');
}
return stats.css.modules[relativeToSrc(path.join(__dirname, './InfoBar.scss'))]; be if (__CLIENT__) {
return require('./InfoBar.scss');
}
const stats = require('../../webpack-stats.json');
return stats.css.modules[relativeToSrc(path.join(__dirname, './InfoBar.scss'))]; since the client side shouldn't be aware of the webpack-stats.json |
@goldensunliu Yes! Good catch. |
I'm running into this issue also and it's broken my heroku deploys since a recent upstream merge. I get the same error as @goldensunliu except that it's triggered from my @erikras I would also prefer not to have |
As a workaround for now, I did manage to get Heroku to deploy again by removing
Obviously not ideal, since it'll show up as modified to your version control every time webpack builds. |
Also, for those working on Heroku, see #81 for how to support their |
Yep, I did that webpack-stats stub thing, too. |
* master: (21 commits) improved syntax for including styles fixed #77 added apology for #60 in the README linted url-loader fix for images switched back to file-loader to avoid error from requireServerImage() fixes #39 Works on mac now Added better-npm-run to allow setting env-vars on all platforms fixed cat pic on server render minor grammar and js style tweak to README added url-loader to production webpack, too merged PR #67. lint-corrected merge. added obligatory cat pic. changed to use url-loader to encode small images. made pass lint incorporated PR #67 and added some comments to promise chaining in createTransitionHook() util import should be in single line. correct the , to , sorry for my keyboard. remove a space :P update README. correct the util error :P add the image server render example to the logo.png. ...
* master: (32 commits) fixed npm script problem and upgraded redux-form added form support with redux-form npm knows how to prefix binaries oops, left in debugger call improved syntax for including styles fixed #77 added apology for #60 in the README linted url-loader fix for images switched back to file-loader to avoid error from requireServerImage() fixes #39 Works on mac now Added better-npm-run to allow setting env-vars on all platforms fixed cat pic on server render minor grammar and js style tweak to README added url-loader to production webpack, too merged PR #67. lint-corrected merge. added obligatory cat pic. changed to use url-loader to encode small images. made pass lint incorporated PR #67 and added some comments to promise chaining in createTransitionHook() work on forms work on forms ...
It will be nice to have this fixed in proper way ... |
A possible solution would be to run Node.js webserver after the first webpack-dev-server build finishes (it's needed only in dev mode). Maybe one could write a .js script which would cycle until |
Good thinking, @halt-hammerzeit. It might be hard to keep them as separate processes, though. Although maybe we don't even want that, since both have to restart on component or css changes. |
@erikras I made it by the way. You can have a look: webpack-isomorphic-tools now has I also made it work with your project and it looks like this: global.webpackIsomorphicTools = new WebpackIsomorphicTools(webpackConfiguration, require('./webpack/webpack-isomorphic-tools')).register().ready(function() {
if (__DEVELOPMENT__) {
if (!require('piping')({
hook: true,
ignore: /(\/\.|~$|\.json|\.scss$)/i
})) {
return;
}
}
require('./src/server');
}) I tested it and it works. |
@halt-hammerzeit i tried to verify this in my project and had to tweak what you have above:
This gets me partway there, but I'm getting the error:
|
Ahh, I see, your |
@bdefore |
well, there's of course a partial solution, my comment wasn't correct. |
@halt-hammerzeit I was initially confused that the name for the configuration was the same as the library itself, but now that I see that, it makes sense. I skimmed through your PR and it does simplify a lot of idiosyncrasies of this boilerplate. |
I'm on vacation this week, but I plan to merge this ASAP. But this is a big PR and I want to test it for myself. |
Vacation |
* master: added webpack-stats stub to fix #60. duh!
since webpack-stats.json is only created after a webpack build, how would the first build ever succeed:
on
npm run build
for the first timeThe text was updated successfully, but these errors were encountered: