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

Livereload is not triggered on file change #674

Closed
alan-agius4 opened this issue Mar 4, 2022 · 15 comments
Closed

Livereload is not triggered on file change #674

alan-agius4 opened this issue Mar 4, 2022 · 15 comments

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Mar 4, 2022

Bug report

Actual Behavior

Live reload is not triggered on file change

Expected Behavior

Live reload is triggered on file change

How Do We Reproduce?

git clone https://github.com/alan-agius4/copy-webpack-plugin-issue.git
yarn
yarn webpack-dev-server --open
mv asset/2.jpeg asset/1.jpeg

Notice that the image is not changed as live reload is not triggered.

  System:
    OS: macOS 11.6.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 4.29 GB / 64.00 GB
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v14.18.1/bin/yarn
    npm: 6.14.16 - ~/.nvm/versions/node/v14.18.1/bin/npm
  Browsers:
    Chrome: 99.0.4844.51
    Firefox: 91.6.0
    Safari: 15.3
  Packages:
    copy-webpack-plugin: ^10.2.4 => 10.2.4 
    webpack: ^5.70.0 => 5.70.0 
    webpack-cli: ^4.9.2 => 4.9.2 
    webpack-dev-server: ^4.7.4 => 4.7.4 
@alexander-akait
Copy link
Member

Can you reproduce it using 5.69.0?

@alexander-akait
Copy link
Member

@alan-agius4
Copy link
Contributor Author

I did try that and I still didn't work. I also tried older version like 5.10 and it still didn't work.

@alexander-akait
Copy link
Member

Maybe related to MacOS...

@alan-agius4
Copy link
Contributor Author

I asked the user that original reported the issue originally in angular/angular-cli#22751 to provide more about their system.

Did live reload work for you when you tried the reproduction?

@alexander-akait
Copy link
Member

alexander-akait commented Mar 4, 2022

@alan-agius4 I haven't tried it yet, I've set it to my tasks, I can look tomorrow, just ask more information as possible

@alan-agius4
Copy link
Contributor Author

alan-agius4 commented Mar 4, 2022

Looks like the user that reported the issue is also using Mac. angular/angular-cli#22751 (comment)

@alexander-akait
Copy link
Member

@alan-agius4 Sorry for delay, looks like problem in webpack, because hash of compilation is the same, so dev server doesn't reload page, I have two workarounds, but want to verify it is valid fixes, I will return to this today/tomorrow (waiting answer)

@alan-agius4
Copy link
Contributor Author

Thanks @alexander-akait!

@alan-agius4
Copy link
Contributor Author

Gentle reminder @alexander-akait

@alexander-akait
Copy link
Member

@alan-agius4 oh, sorry, missed that, put in my TODO for tomorrow

@Mylogin-info
Copy link

@alexander-akait

Same issue on Windows. Angular 14.

[webpack-dev-server] App updated. Recompiling...
[webpack-dev-server] Nothing changed.

Change in files in the app folder and globel scss files are detected. Change in files in the assets folder are not detected.

image

@alexander-akait
Copy link
Member

alexander-akait commented Jun 7, 2022

@alan-agius4 @Mylogin-info bug in webpack-dev-server, we can't fix it here webpack/webpack-dev-server#3794, updated an issue and put your example, copy-webapck-plugin does right job here, dev server doesn't respect hash changed

@alan-agius4
Copy link
Contributor Author

@alexander-akait, thanks let's continue tracking this in webpack/webpack-dev-server#3794

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2022
@Trirandom
Copy link

Same issue on Windows. Angular 14.

[webpack-dev-server] App updated. Recompiling...
[webpack-dev-server] Nothing changed.

Force those who are looking for a workaround,
I used the package "@angular-builders/custom-webpack": "^14.1.0" that allows to use an extra webpack config, and in this file:

module.exports = {
    devServer: {
        watchFiles: ["src/**/*"],
    },
};

This solved my issue, hope it helps.

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

4 participants