Flex-layout: Flex-layout doesn't work properly with SSR and lazy modules

Created on 12 Mar 2018  路  9Comments  路  Source: angular/flex-layout

Bug, feature request, or proposal:

Flex-layout adds empty stylesheets during server side rendering for lazy modules.

What is the expected behavior?

CSS shouldn't be empty.

Reproduction repo

https://github.com/atmman9001/universal-starter/ flex-layout-issue branch

What are the steps to reproduce?

  1. pull the repo
  2. checkout to flex-layout-issue branch
  3. npm i
  4. npm run build:ssr && npm run serve:ssr
  5. Go to http://localhost:4000/lazy
  6. Check style.flex-layout-ssr contains just {} - Example screenshot
P1 bug has pr ssr

All 9 comments

Confirmed as an issue, likely because the lazy module is pulling in the browser providers instead of the server providers.

Will try to get a fix in this week, but @ThomasBurleson is currently away, so it might take a little longer to get it merged.

@CaerusKaru - Thanks for the quick reply.

Phew glad I found this issue. This is huge since Angular best-practices is really to lazy-load every module. All of my pages therefore have a flash of improperly-styled content. Looking forward to a fix as this is sort of a big deal

@stephengardner I agree, and this is my top priority as of this morning. Unfortunately our DI setup for this library is a little muddled. As I mentioned in #373, this will be completely resolved when v6 arrives, but until then, and regardless, I'm working on a fix for 5.x

@CaerusKaru fantastic! Knowing it's a known issue and in-progress is all the news I need. Looking forward to it

@stephengardner @atmman9001 Ok I've got the fix working, it's in PR #659. Unfortunately, this likely won't get merged until @ThomasBurleson gets back sometime next week. If necessary you can build it from the remote branch until then

Thanks @CaerusKaru!

Great thanks @CaerusKaru!

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nueko picture nueko  路  5Comments

WilhelmOlejnik picture WilhelmOlejnik  路  4Comments

MarcusMorba picture MarcusMorba  路  3Comments

mhosman picture mhosman  路  3Comments

intellix picture intellix  路  4Comments