René's URL Explorer Experiment


Title: SSR dev-server HMR does not dispose hydrated layout, causing duplicated components after root template change · Issue #32256 · angular/angular-cli · GitHub

Open Graph Title: SSR dev-server HMR does not dispose hydrated layout, causing duplicated components after root template change · Issue #32256 · angular/angular-cli

X Title: SSR dev-server HMR does not dispose hydrated layout, causing duplicated components after root template change · Issue #32256 · angular/angular-cli

Description: 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 No response Description Summary In an SSR-enabled Angular project, when running ng ser...

Open Graph Description: 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 No response Description Summary In an SSR-enab...

X Description: 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 No response Description Summary In an SSR-enab...

Opengraph URL: https://github.com/angular/angular-cli/issues/32256

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSR dev-server HMR does not dispose hydrated layout, causing duplicated components after root template change","articleBody":"### Command\n\nserve\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\n### Summary\nIn an SSR-enabled Angular project, when running `ng serve`, editing the root component template (`src/app/app.html`) and then refreshing the browser results in duplicated layout DOM nodes. Header/footer appear twice.\n\nDevTools shows **two sibling `app-shell` elements under a single `app-root`** (the root is not duplicated; only the layout is duplicated). This does **not** reproduce in a non-SSR project.\n\n### Expected\nAfter saving template changes and refreshing, the hydrated SSR component tree should be disposed properly and the layout should render exactly once.\n\n### Actual\nAfter editing the root template and refreshing:\n- previous hydrated layout is not destroyed\n- a second `app-shell` is appended\n- header/footer are rendered twice\n- DOM order becomes inconsistent (router-outlet ends up between the two layouts)\n\n### Notes\nI have attached screenshots (DevTools Elements) showing `app-shell` duplicated the repro.\n\n### ng serve\n\u003cimg width=\"1904\" height=\"804\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/a5c471cb-8855-422d-920a-426788252ce9\" /\u003e\n\n### After change and save\n\u003cimg width=\"1883\" height=\"818\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/804cfa1f-e264-4e0d-b778-e0dc3eb548bd\" /\u003e\n\n### After refresh page\n\u003cimg width=\"1919\" height=\"848\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0b22b643-c2fb-4d1e-a570-a7cff956df04\" /\u003e\n\n### Minimal Reproduction\n\n### Repro repo\n\nhttps://github.com/alikarimli/angular-ssr-hmr-duplication-repro.git\n\n### Steps\n1. `git clone https://github.com/alikarimli/angular-ssr-hmr-duplication-repro.git`\n2. `npm ci`\n3. `npx ng serve`\n4. Open the app in the browser.\n5. Edit `src/app/app.html` (add a comment or whitespace), save.\n6. Refresh the browser.\n7. Observe duplicated layout (header/footer). In DevTools, `app-shell` appears twice under a single `app-root`.\n\n### Important\n- This only reproduces with SSR enabled.\n- A non-SSR project does not reproduce the issue.\n\n\n### Exception or Error\n\n```text\nNo exception is thrown. No console errors observed.\n```\n\n### Your Environment\n\n```text\nAngular CLI: 20.3.7\nNode: 22.20.0\nPackage Manager: npm 11.6.2\nOS: win32 x64\n\nAngular: \u003cerror\u003e\n... build, common, compiler, compiler-cli, core, forms\n... platform-browser, platform-server, router, ssr\n\nPackage                      Version\n------------------------------------\n@angular-devkit/architect    0.2003.7 (cli-only)\n@angular-devkit/core         20.3.7 (cli-only)\n@angular-devkit/schematics   20.3.7 (cli-only)\n@angular/cli                 20.3.7 (cli-only)\n@schematics/angular          20.3.14\nrxjs                         7.8.2\ntypescript                   5.9.3\nzone.js                      0.15.1\n```\n\n### Anything else relevant?\n\n- Browser: Chrome (latest) on Windows 11\n- Happens only after editing the root template (`src/app/app.html`) while dev-server is running and then refreshing the page.\n- `app-root` is not duplicated; only `app-shell` is duplicated (see attached DevTools screenshots).\n- Workaround: `ng serve --no-hmr` prevents the issue (if applicable).\n","author":{"url":"https://github.com/alikarimli","@type":"Person","name":"alikarimli"},"datePublished":"2026-01-09T22:25:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/32256/angular-cli/issues/32256"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1594b67a-8b1f-70c7-7d21-89fd139b1fff
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9B44:32B525:75D7CE:9CD733:696487A4
html-safe-noncedcd904261a73a24dc24ab91095ae27de5ca58806fba364ec8350969e18af14aa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjQ0OjMyQjUyNTo3NUQ3Q0U6OUNENzMzOjY5NjQ4N0E0IiwidmlzaXRvcl9pZCI6IjI3ODU2OTQ5NjM2NTczNzc3MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace3df3a511f1212a161c7eb85e1b493bb5c3c3ec4ce666a983947984a54b66c88
hovercard-subject-tagissue:3798529487
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/32256/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0fdf21f566549f2b9b957510be4a1bbfa15d95ac9c903e52da910f7036260dba/angular/angular-cli/issues/32256
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0fdf21f566549f2b9b957510be4a1bbfa15d95ac9c903e52da910f7036260dba/angular/angular-cli/issues/32256
og:image:altCommand 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 No response Description Summary In an SSR-enab...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealikarimli
hostnamegithub.com
expected-hostnamegithub.com
Nonebaa7d9900fdf7b27d604f36887af878d569cfbdcf97126832a5f4f0caf0c6ba5
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release842eff1d11f899d02b6b3b98fa3ea4860e64b34e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/32256#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F32256
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F32256
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/32256
Reloadhttps://github.com/angular/angular-cli/issues/32256
Reloadhttps://github.com/angular/angular-cli/issues/32256
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 265 https://github.com/angular/angular-cli/issues
Pull requests 21 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/angular/angular-cli/security
Please reload this pagehttps://github.com/angular/angular-cli/issues/32256
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/32256
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/32256
SSR dev-server HMR does not dispose hydrated layout, causing duplicated components after root template changehttps://github.com/angular/angular-cli/issues/32256#top
https://github.com/alikarimli
https://github.com/alikarimli
alikarimlihttps://github.com/alikarimli
on Jan 9, 2026https://github.com/angular/angular-cli/issues/32256#issue-3798529487
https://private-user-images.githubusercontent.com/23343421/534126015-a5c471cb-8855-422d-920a-426788252ce9.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNv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YwMTEyVDA1MzMyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2MTJiZmIxOWI2MDVjMGI1MmZiYzE5N2NlODllNTVlY2I5NTU2Y2U4N2M5MWVjMTBhMDU3M2EzMGRkMjkzZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.30pMRN935tcZXn9_VcGNnpe6jcrVLdye9fMXEljlbfY
https://private-user-images.githubusercontent.com/23343421/534126684-0b22b643-c2fb-4d1e-a570-a7cff956df04.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjgxOTYzMDQsIm5iZiI6MTc2ODE5NjAwNCwicGF0aCI6Ii8yMzM0MzQyMS81MzQxMjY2ODQtMGIyMmI2NDMtYzJmYi00ZDFlLWE1NzAtYTdjZmY5NTZkZjA0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTEyVDA1MzMyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJmOGY4MjQwZjE5YzNhYzE3NjM4Nzc1ZTZiNTk0NmY0MDM1YzhhMzQwNmY2YzdhMjU3YzZiMzMxYmYwZWFkNjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oPNRJ_DZ-5FPw1nJXCPQk3S7wNV97XKp7GJGZcRLirw
https://github.com/alikarimli/angular-ssr-hmr-duplication-repro.githttps://github.com/alikarimli/angular-ssr-hmr-duplication-repro.git
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.