Closed KERIST closed 2 years ago
Hey @KERIST :wave:, Thank you for opening an issue. We'll get back to you as soon as we can. Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers. If you use Loadable at work, you can also ask your company to sponsor us :heart:.
Hey @KERIST. I had the exact same issue. It took me some time to realize as well, but you have to render the app before you collect the script tags. This is how loadable knows what chunks are required for the current render.
Move your renderToString
to above the getLinkTags
etc.
+ const appHtml = ReactDOMServer.renderToString(sheet.collectStyles(jsx));
const scriptTags = webExtractor.getScriptTags();
const linkTags = webExtractor.getLinkTags();
const styleTags = webExtractor.getStyleTags();
- const appHtml = ReactDOMServer.renderToString(sheet.collectStyles(jsx));
It's documented here but it really should explicitly say that the order is very important.
@LudvigHz Thank you so much for your help!
💬 Questions and Help
Loadable Components project is young, but please before asking your question:
After you can submit your question and we will be happy to help you!
Hello. The problem is LOADABLE_REQUIRED_CHUNKS is empty and because of it I suppose react don't hydrate and app is running with no event listeners. I've been trying to solve it for many days. There is a similiar issue, but it closed unresolved. Please help me.
Here is a repository with code: https://github.com/KERIST/loadable-help.