Skip to content
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

webpack dev server not recompiling certain files when they are changed #724

Closed
cchrysostomou opened this issue Dec 26, 2016 · 4 comments
Closed

Comments

@cchrysostomou
Copy link

I am having a weird issue with my current webpack dev server configuration. The issue seems to be with my entry points. If I am defining entry points using {key: values}, then for some reason , if one of my entry points is deeply nested (found in many subfolders), the webpack server does not seem to recompile those files when I have changed them.

Here is an example of a configuration setup for my entry points

entry: {
    App2Doesnotrecompile: './reactjs/subfolder/sub/sub/app2',
    App1: './reactjs/app1',
    App3: './reactjs/subfolder/sub/app3'
  },

In the example above, if i make changes to the files in App1 or App3 then the webserver recompiles and shows me if any errors occurred; but if i make changes to the file in app2 then the webserver does not seem to register any changes.

I am not sure if this is an issue or something wrong with my configuration.

I am currently using ubuntu 16.04.

The following is a non-detailed version of my configuration file

{
  context: __dirname,

  entry: {
     App2Doesnotrecompile: './reactjs/subfolder/sub/sub/app2',
    App1: './reactjs/app1',
    App3: './reactjs/subfolder/sub/app3'
  },

  output: {
      path: path.resolve('./djreact/static/bundles/local/'),
      filename: "[name]-[hash].js",
  },

  externals: [
  ], 

  plugins: [
  ], 

  module: {
    loaders: [] // add all common loaders here
  },

  resolve: {
    modulesDirectories: ['node_modules', 'bower_components'],
    extensions: ['', '.js', '.jsx']
  },
}
@SpaceK33z
Copy link
Member

This might possibly have to do with webpack/watchpack#28.

You could try to apply this PR manually in node_modules/watchpack, and see if the issue still occurs.

If that doesn't help, please try if the same problem happens when using webpack --watch. If it does, it's a problem in webpack and not webpack-dev-server. In any case, please provide a repo where this is reproducable. It takes us too much time to try to reproduce every issue by hand.

@cchrysostomou
Copy link
Author

Thanks for your help. So I tried some of your suggestions above and Im not sure they worked. At this point I'm beginning to think its not an issue with webpack but more with something funky on my setup. I think this because if I restart the computer and run the server for the first time everything seems to work fine; but once I restart the server a second time, then I see the issues described above.

As you asked I went ahead and created a repository, webpacktest, and it seems to work fine on an Ubuntu 14.04 setup.

@SpaceK33z
Copy link
Member

Okay, when/if you can reproduce it in a repo, please file a bug report in webpack/webpack.

@cchrysostomou
Copy link
Author

OK so it seems to be working for now on my ubuntu16.04 system. Based on what you said, I started researching potential issues with watchpack and I found the following from: http://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files

The suggestion to increase the number of watchers seems to have worked for me:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Im still fairly new to all of this so I am not sure if this was my actual problem, how the number of watchers suddenly changed, or why this helped my issue with nested files.

Hopefully, I wont have any more issues with this. thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants