Skip to content

webpack-dev-server not detecting file changes #2833

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

Closed
denis-productops opened this issue Oct 22, 2016 · 7 comments · Fixed by #2920
Closed

webpack-dev-server not detecting file changes #2833

denis-productops opened this issue Oct 22, 2016 · 7 comments · Fixed by #2920
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@denis-productops
Copy link

denis-productops commented Oct 22, 2016

Please provide us with the following information:

OS?

Mac OSX Yosemite 10.10.5

Versions.

$ ng version
angular-cli: 1.0.0-beta.15
node: 6.6.0
os: darwin x64
$ node --version
v6.6.0

Repro steps.

Have been developing this angular-cli app for weeks. To my knowledge, I did not change any module versions or anything.

I recently added a bunch of new components and WDS has stopped detecting changes and does not reload.

ng serve does detect changes and recompiles (see log below), but in browser console, WDS says:

[WDS] App updated. Recompiling...
[WDS] Nothing changed.

The log given by the failure.

ng serve:

webpack: bundle is now INVALID.
257ms building modules
6ms sealing
0ms optimizing
0ms basic module optimization
51ms module optimization
1ms advanced module optimization
7ms basic chunk optimization
0ms chunk optimization
0ms advanced chunk optimization
9ms module and chunk tree optimization
127ms module reviving
3ms module order optimization
3ms module id optimization
3ms chunk reviving
1ms chunk order optimization
10ms chunk id optimization
70ms hashing
1ms module assets processing
0ms chunk assets processing
5ms additional chunk assets processing
0ms recording
0ms additional asset processing
0ms chunk asset optimization
844ms asset optimization
3ms emitting
Hash: cf70a13530d80bb09d40
Version: webpack 2.1.0-beta.22
Time: 3587ms
                               Asset     Size  Chunks       Chunk Names
                   scripts.bundle.js    49 kB    2, 3       scripts
83d61daa58e37c98ea2516d9e1d2c44e.gif  44.5 kB
b406e72d99d9f9fb8502a3c0c902ff49.jpg  1.77 MB
                      main.bundle.js  4.58 MB    0, 3       main
                    styles.bundle.js  61.8 kB    1, 3       styles
70c27db6b2012a94cf0d990dae6d92b8.png  23.2 kB
                           inline.js  5.53 kB       3       inline
                            main.map  4.97 MB    0, 3       main
                          styles.map  81.5 kB    1, 3       styles
                         scripts.map  60.9 kB    2, 3       scripts
                          inline.map  5.59 kB       3       inline
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  3.46 kB       0
webpack: bundle is now VALID.

WDS:

[WDS] App updated. Recompiling...
[WDS] Nothing changed.

Mention any other details that might be useful.

When this stopped working I installed watchman (with brew), but that didn't seem to make any difference.


Thanks! We'll be in touch soon.

@denis-productops
Copy link
Author

Note, I also did these, without any effect:

rm -rf node_modules
npm cache clean
npm install -g angular-cli
npm install

@denis-productops
Copy link
Author

Actually, interesting:

The browser console has 2 "recompiling" log statements and only one "nothing changed..."

developer_tools_-_http___localhost_4200_

@denis-productops
Copy link
Author

Found the issue. I generated the components using a command like this:

ng generate component _components/sections/Lmi/Programs

ng generate puts this component into

./src/app/_components/sections/lmi/programs.component.css
./src/app/_components/sections/lmi/programs.component.html
./src/app/_components/sections/lmi/programs.component.spec.ts
./src/app/_components/sections/lmi/programs.component.ts

(note case of the path and filenames)

but updates app.module.ts like this:

import { ProgramsComponent } from './_components/sections/Lmi/programs.component';

@filipesilva
Copy link
Contributor

@Brocco can you have a look? If we generate files lowercase, the imports should be lowercase as well.

@filipesilva
Copy link
Contributor

To clarify, this issue is closed because there isn't anything else to be done on the CLI side. We fixed ng generate to not convert import paths to lowercase.

If you still have the wrong capitalization (e.g. ./path/to/file vs ./Path/To/file) on imports, your project might not detect file changes even though your project compiles. This is because different OSs have different rules for paths in the system.

@ghost
Copy link

ghost commented Mar 17, 2018

It's worked. Thank you very much

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants