Skip to content

HMR not working properly #22839

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
jonathanwilke opened this issue Mar 14, 2022 · 5 comments
Closed

HMR not working properly #22839

jonathanwilke opened this issue Mar 14, 2022 · 5 comments

Comments

@jonathanwilke
Copy link

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

I cannot get HMR to work properly. It always gives me the following error in the browser console.

browser console

I noticed that for some reason on every save of any file there are two builds, which would at least explain why the file cannot be found. It looks like this in the terminal:

terminal

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 13.2.6
Node: 16.14.0
Package Manager: npm 8.3.1
OS: darwin x64

Angular: 13.2.6
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, platform-browser-dynamic
... router

Anything else?

No response

@JoostK JoostK transferred this issue from angular/angular Mar 14, 2022
@ngbot ngbot bot modified the milestone: needsTriage Mar 14, 2022
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Mar 14, 2022
@alan-agius4
Copy link
Collaborator

Can you check if using the latest webpack fixes the issue?

Can you add the below overrides in your package.json and run npm install

{
  "overrides": {
    "webpack": "5.70.0"
  }
}

@jonathanwilke
Copy link
Author

This seems to solve the problem, thank you so much!

@alan-agius4
Copy link
Collaborator

I opened a PR to update webpack which should be released later on this week.

Please keep note to remove the overrides once you update to 13.3.0.

@alan-agius4 alan-agius4 self-assigned this Mar 15, 2022
clydin pushed a commit that referenced this issue Mar 15, 2022
This brings a couple of fixes to HMR, one of which is double reloaded.
See: https://github.com/webpack/webpack/releases/tag/v5.70.0

Closes #22839
@alan-agius4
Copy link
Collaborator

Closed via #22841

@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 Apr 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants