Repository navigation
Closed
1 / 11 of 1 issue completedClosed
1 / 11 of 1 issue completed
Copy link
Labels
Milestone
Description
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
I don't know how to create a reproduction with SSR on Stackblitz, so please read it first and check the videos - perhaps you'll see what I'm talking about and what could cause that and perhaps it is a duplicate (I tried searching).
So, in the template, we have:
...
@if (store.$isAuthenticated()) {
<div class="nav-btn" (click)="...">
<mat-icon svgIcon="account"/>
<span i18n="@navbar.account" class="btn-label">Account</span>
</div>
} @else {
<div class="nav-btn" (click)="...">
<mat-icon svgIcon="account"/>
<span i18n="@navbar.signup" class="btn-label">Sign Up</span>
</div>
}
...As you can see, they can never be rendered together.
But if I use withI18nSupport():
with.mov
And if I remove withI18nSupport():
without.mov
This is ng serve with "ssr": true, but deployed versions behave the same.
Full app config:
export const appConfig: ApplicationConfig = {
providers: [
provideExperimentalZonelessChangeDetection(),
provideRouter(appRoutes,
withComponentInputBinding(),
withInMemoryScrolling({
anchorScrolling: 'enabled',
scrollPositionRestoration: 'top',
}),
withRouterConfig({
onSameUrlNavigation: 'ignore',
urlUpdateStrategy: 'eager'
}),
withPreloading(CrPreloadingStrategy)
),
provideAnimationsAsync(),
provideHttpClient(withInterceptors([authInterceptor]), withFetch()),
provideClientHydration(
withIncrementalHydration(),
withEventReplay(),
),
provideNgxStripe(),
// provideServiceWorker('ngsw-worker.js', {
// enabled: !isDevMode(),
// registrationStrategy: 'registerWhenStable:30000'
// }),
{
provide: IMAGE_LOADER,
useValue: (config: ImageLoaderConfig) => cloudflareImgLoader(config, environment.imgDomain)
},
....Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Angular 19.0.0-rc.2 and rc.1 (checked).
Anything else?
No response
Reacted by Boris Prpic
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Activity
e-oz commentedon Nov 14, 2024
Forgot to mention: this also causes significant layout shifts and drops the Lighthouse score from 98 to 72. Just one single thing.
thePunderWoman commentedon Nov 14, 2024
@e-oz This is a really nice report! Thanks for that. Any chance you can create a very minimal reproduction for us so we have something to start with for debugging purposes?
e-oz commentedon Nov 14, 2024
@thePunderWoman I will try tomorrow. Just checked if it's not a known issue.
AndrewKushnir commentedon Nov 14, 2024
@e-oz do you see a different behavior if you remove
i18nattributes from elements in your template? I'm also wondering if you see any warnings in developer console (we output a warning if post-hydration cleanup didn't happen within 10 seconds)?e-oz commentedon Nov 14, 2024
@AndrewKushnir
no, same behavior. And when I run
ng serve, it prints this:The deployed version uses i18n, so i18n attributes make no difference.
the only thing in console:
it happens during 1-3 seconds without network throttling, and during ~6 seconds with "fast 4G" throttling.
AndrewKushnir commentedon Nov 14, 2024
@e-oz thanks for additional information. As @thePunderWoman mentioned, we'd need a minimal repro to investigate the issue more.
The warning that I was referring to appears after 10 seconds (source code).
e-oz commentedon Nov 15, 2024
Here is the reproduction:
https://stackblitz.com/~/github.com/e-oz/bug-with-i18n
You can see that the cat is alive and dead simultaneously for a fraction of a second.
Here is the repo:
https://github.com/e-oz/bug-with-i18n
27 remaining items
fix(core): fixes timing of hydration cleanup on control flow (angular…