TrilonIO / aspnetcore-angular-universal

ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.46k stars 434 forks source link

Two app-root bindings #672

Open makulatura opened 6 years ago

makulatura commented 6 years ago

Hey, I am having troubles with component css - it prerendered, but when angular kicks in, it's gone (other css files, that are loaded directly from view works fine).

First thing I am seeing is two app-root bindings - is this how it should be? After browser kicks in, first app is hidden and for second app - no css gets applied. I don't see this kind of running app structure neither in my own angular v.4.3, nor in a bit older version of this template.

image

I am currently migrating from angular 4.3 --> 6.0.7. Both has SSR enabled (thank you for creating this awesome template).

ogvu12 commented 6 years ago

I'm also experiencing the same issue. In my case however, during the initial load or on a refresh, the display property stays stuck at none. The page works fine when I disable SSR.

daveharmswebdev commented 6 years ago

I am also seeing this phenomenon.

image

daveharmswebdev commented 6 years ago

The first one is hidden the second one has no CSS.

makulatura commented 6 years ago

@daveharmswebdev, @ogvu12 any progress on this? My temporary solution was to comment out PrebootModule module in both app.module files.

Chris3773 commented 6 years ago

I'm running into this same problem. Based on my testing it looks like the app-root that is displaying is from the server and the other is the browser version. However it's not switching over to the browser and gets stuck with the prerender data as all actions are stopped by the preboot.

This doesn't seem to be problem if the project is built for PROD as everything is working.

NielsNauwynck commented 5 years ago

@makulatura Do you by any chance host on Azure and have Application Insights enabled, looks like i'm only having these duplicate app-roots when application insights is enabled