I am stuck with Angular 15 because of some libraries that need to be replaced.
Anyways, after upgrading to Angular 15, the meta tags are not properly loading anymore. That is the main problem. Why would I need SSR if not for proper meta tags?
My setup:
-
No lazy modules.
-
router:
{path: “”, component: HomeComponent, resolve: {
someHomePageData, language } },{path: “product/:id”, component: DetailComponent, resolve: { singleProductData, language, images } },
…{ path: “**”, pathMatch: ‘full’, redirectTo: “not-found” },
…
initialNavigation: “enabledBlocking”, -
interceptors
server-state –> with memory-cache
browser-state
-
server.ts
the basic:server.get(“*”, (req, res) => {
res.render(indexHtml, {
req,
providers: [
{ provide: APP_BASE_HREF, useValue: req.baseUrl },
]
});
}); -
Well and Ionic.
Everything pretty basic and it worked with Angular 14.
I am trying to reload a detail/product page, but the meta tags of the homepage are shown.
In the logs, the homepage OnInit shows up. If I set the route of the homepage to “home”, the conflict seems to disappear. But I don’t want to have a “home” route.
And yes, after refreshing the browser, the home page flickers up as well.
I’ve read every possible github and SO article already.
I also tried setting a canActivate and loading all the detail data and meta tags in there. Which worked locally (when running the server.ts) but not on a real domain.
The question is, what else should I look at? Except Angular 18 sooner or later.