question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loadable components not rendering on server

See original GitHub issue

Loadable component on ssr not rendering on server but works fine on client side. In my main container header and footer is rendering on server only component with loadable is not loading on server

react version

"react": "^16.12.0" "react-router-config": "^1.0.0-beta.4", "react-router-dom": "^4.3.0", "react-router-redux": "^5.0.0-alpha.9"

server.js

<ChunkExtractorManager extractor={extractor}> <Provider store={store}> <StaticRouter location={location} context={context}> <ReduxAsyncConnect routes={routes} /> </StaticRouter> </Provider> </ChunkExtractorManager>

Client.js loadableReady(() => { hydrate( <Provider store={store}> <ConnectedRouter history={history}> <ReduxAsyncConnect routes={routes} /> </ConnectedRouter> </Provider>, document.getElementById('app') ); })

Webpack plugin also added. stats.json file is created with chunk hash values. What am i doing wrong here? Please help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kri7217commented, Jan 13, 2021

@kri7217 How did you fix it?

How did you export the components ? And how you are dynamically importing for creating chunks ?

export will always be default for loadable I corrected above two areas and it worked.

0reactions
damassicommented, Jan 13, 2021

export will always be default for loadable

Note that in a recent update this is now configurable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server Side Rendering
Loadable components loads all your scripts asynchronously to ensure optimal performances. All scripts are loaded in parallel, so you have to wait for...
Read more >
loadable/componet not loading on server side rendering
The loadable component on SSR not rendering on the server but works fine on the client-side. In my main container header and footer...
Read more >
Loadable-components NPM
Splitting your React application and rendering it server-side is complicated. ... There is no built-in API in loadable-components but you could do it...
Read more >
What are the differences between React.lazy and @ ...
Both React.lazy and @loadable/components are mainly being used ... React.lazy and Suspense are not yet available for Server-Side Rendering.
Read more >
Using Client-Side Only Packages
In the component where you need it, load the package via CDN using a <script /> tag. ... React.lazy and Suspense are not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found