Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR || Prod - page flashes on first load #53

Open
czco opened this issue Mar 8, 2019 · 12 comments
Open

SSR || Prod - page flashes on first load #53

czco opened this issue Mar 8, 2019 · 12 comments

Comments

@czco
Copy link

czco commented Mar 8, 2019

Absolutely love the framework and we've developed two sites on the framework. One of them is about Custom Software Development. If you open it you'll notice page flashes on the first load. The same happens with the other site we published but cannot share the URL. Anyone have an idea why and what can be done to prevent it?

@czco czco changed the title page flas on first load SSR || Prod - page flashes on first load Mar 8, 2019
@heshamelmasry77
Copy link

@czco this is the main problem which made me decide to move to next js

@czco
Copy link
Author

czco commented Mar 12, 2019

@heshamelmasry77 we love Next.js, we have been using next.js for 3 years but it can be slow and painful. Recently we built a CRM that can text on next.js.

  • Try using it with React material-ui.
  • Try upgrading a next 4.x to next 8.x platform.
  • when external library wants to import a css file, try using withcss(withscss together

we can list 50 issues we came across with next.js in last 3 years. its an overkill if all we want is blog content readable by google and standard CRA pattern with React Router.

Also the main problem we moved to this was Google webmaster tools not seeing next.js content right away Checkout this issue. Ideal situation would be that @cereallarceny can give some input on how to solve this flash and then us going back to next.js

@heshamelmasry77
Copy link

@czco I also noticed how slow it is when i moved to next js. and the next config looks crab. I hope someone find a solution for the flashing problem. This flashing problem happens because of the css. some people solved it using styled components and some other people solved by adding the styles as chunks.
something like that :

 const extraCSS = extractAssets(manifest, {}, '.css')
            .map(c => `<link href="/${c}" rel="stylesheet">`);

and use the chunks first load,

@czco
Copy link
Author

czco commented Mar 14, 2019

@heshamelmasry77 we are using styled-components, we were thinking the flash is because of styled-components but again we need @cereallarceny. it would bother us to see this awesome repo die because of no support.
@francisrod01 what's the thumbs-down for?

@czco
Copy link
Author

czco commented Mar 14, 2019

Having done a fresh deployment of cra-ssr with styled-components, there is no page flash so this may an issue with some other change we made. If you are facing the same issue please reach out, we hopefully might find a solution soon
deployed fresh app

@czco czco closed this as completed Mar 14, 2019
@czco czco reopened this Mar 17, 2019
@czco
Copy link
Author

czco commented Mar 17, 2019

The reason there is no page flash on a fresh deployment of cra-ssr is that none of the routes contain components. If inside any route you create a component, let's say and put the HTML in there it will flash, the flash is due to initial load on the server plus reload on the client.. Does anyone know how to fix this? @cereallarceny @arturparkhisenko @gbreux

Issue can be seen at Silicon Beach Developers

@francisrod01
Copy link

francisrod01 commented Mar 17, 2019

WE all need to put the routes after an initial "HTML" structure.
This repository is just an example of how to build a CRA SSR application, but isn't the better one.

@czco
Copy link
Author

czco commented Mar 18, 2019

@francisrod01 its a technical problem and we are sure there is a solution. let's focus on finding that

@francisrod01
Copy link

francisrod01 commented Mar 18, 2019

its a technical problem and we are sure there is a solution. let's focus on finding that

WE all need to put the routes after an initial "HTML" structure.

You right!

@czco
Copy link
Author

czco commented Mar 19, 2019

@francisrod01 Thanks you for attempting to provide a solution.
Unfortunately, we need to used styled-components and have page-level components for page-level content.. Some time was wasted moving from next.js to cra-ssr and back to next.js. Overall we feel it's not ready for production use though it is a great attempt and we love the project

@cereallarceny
Copy link
Owner

@czco My apologies, I haven't been very responsive with this project. It's my full intention to pick things up again, despite the fact that you've moved on to Next. It's a great framework, I don't blame you. If you're interested, I'm logging this as an issue to be fixed by version 2.

@cereallarceny cereallarceny mentioned this issue Jun 19, 2019
16 tasks
@cereallarceny
Copy link
Owner

@heshamelmasry77 I also understand you moved to Next.js. I plan to pick up active development on this project again if you're interested. In particular, I'll pay close attention to page flashing. It was an issue on my implementations of cra-ssr as well. If you're interested in contributing (or anyone in this thread for that matter), I'd be thrilled to have the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants