Skip to content

HMR updates triggers full page reload when SSR is enabled #29372

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
1 task done
alan-agius4 opened this issue Jan 16, 2025 · 1 comment · Fixed by #29381
Closed
1 task done

HMR updates triggers full page reload when SSR is enabled #29372

alan-agius4 opened this issue Jan 16, 2025 · 1 comment · Fixed by #29381

Comments

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jan 16, 2025

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

In version 19.1.0-rc.0, updating a component's stylesheet did not trigger a full page reload, whereas updates to component templates always did.

Description

When SSR is enabled in ng serve, HMR updates are always followed by a full page reload.

Minimal Reproduction

$ ng new --ssr --server-routing
$ ng s

Next, update the template or stylesheet of a component. In the console, you will see both Component update sent to client(s). and Page reload sent to client(s). being displayed.

Exception or Error

When SSR is enabled, hot module replacement (HMR) is executed but is immediately followed by a full page reload.

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 19.1.1
Node: 20.17.0
Package Manager: yarn 1.22.22
OS: linux x64

Angular: 19.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser-dynamic, platform-server, router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.1
@angular-devkit/build-angular   19.1.1
@angular-devkit/core            19.1.1
@angular-devkit/schematics      19.1.1
@angular/platform-browser       19.0.0
@schematics/angular             19.1.1
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else relevant?

No response

@alan-agius4 alan-agius4 changed the title HMR updates triggers full page reload when SSR Is enabled HMR updates triggers full page reload when SSR is enabled Jan 16, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 17, 2025
… enabled

This commit resolves an issue where HMR would incorrectly trigger a full page reload when used with SSR.

Closes angular#29372
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 17, 2025
… enabled

This commit resolves an issue where HMR would incorrectly trigger a full page reload when used with SSR.

Closes angular#29372
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 17, 2025
… enabled

This commit resolves an issue where HMR would incorrectly trigger a full page reload when used with SSR.

Closes angular#29372
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 17, 2025
… enabled

This commit resolves an issue where HMR would incorrectly trigger a full page reload when used with SSR.

Closes angular#29372
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Jan 17, 2025
… enabled

This commit resolves an issue where HMR would incorrectly trigger a full page reload when used with SSR.

Closes angular#29372
alan-agius4 added a commit that referenced this issue Jan 17, 2025
… enabled

This commit resolves an issue where HMR would incorrectly trigger a full page reload when used with SSR.

Closes #29372

(cherry picked from commit 03ac417)
@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 Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant