I get an error. Check the render method of `InnerLoadable`
When I try to navigate to other async component in react router I get
And when I reload the page everything works again
Issue reproduced here https://github.com/pavliha/ssr-app.
Hello @pavliha, I gave a quick look in your code and everything looks fine for me. Maybe someone else could give a look and help you!
Thanks for checking out this case @neoziro. For some reason await import('./TestScene') returns empty object

And later I figured out this is react-hot-loader breaks everything. How react-hot-loader affects module import is still a question. I think this is because I'm using webpack-dev-middleware instead of webpack-dev-server. Looks like react-hot-loader and webpack-dev-middleware does not work together as expected
Double checked - loadable and RHL are not playing well together (no automatic reload), but no error is present.
@pavliha - could you disable source maps and give me final sources for TestScene - let's find the root cause.
@theKashey. I've updated the repo maybe something was missing. Hmm maybe I could write some steps to reproduce an issue. Just in case
- yarn install
- rename .env.example to .env
- yarn start
- open http://localhost:2000
- click on test link
In the updated repo. I have disabled source maps and connected sources of the @loadable/component via webpack aliases

I have a similar setup but with webpack-dev-server and loadable works with react-hot-loader. It is webpack-dev-middleware that causing the problems. Official documentation for react-hot-loader says it's not yet supported

That's now "official" documentation, as long as we dropped a ball on it a bit, but it's supported - the problem is more about proper configuration. I will try to fill this gap in the documentation.
@theKashey thank you a lot. Have you tried to find core problem in this particular case?
Not yet.
Long story short - everything is very bad:
- RHL thinks that HMR is "active"
- RHL does not sees
IndexandTestas a "registered" variables - RHL does a false positive merge of
IndexandTest, thinking thatIndex"isReady"(exists in the cache), and then callingrequireSyncforTest. Don't ask.
- HMR is open after
importinga new code block. That's expected behavior - False positive for
forwardRef. Something to be fixed.
- fix created. Will release a new version of RHL in an hour. No changes from
loadable-componentare required.
I have the same issue. I am using react-router-dom.
` const HomePage = loadable(() => import(/* webpackPrefetch: true / '../pages/AuthPages/HomePage')); const RepresentativeRegistrationPage = loadable(() => import(/ webpackPrefetch: true */ '../pages/AuthPages/RepresentativeRegistrationPage') );
<Route
exact
path={ROUTES.HOME_PAGE}
render={(props) =>
(!isAuthentificated ? <Redirect to={ROUTES.LOGIN} /> : <HomePage {...props} />)}
/>
<Route
exact
path={ROUTES.REPRESENTATIVE_REGISTRATION}
render={(props) => !isAuthentificated ? <Redirect to={ROUTES.LOGIN} /> :
<RepresentativeRegistrationPage {...props} />}
/>
`
When I have Redirect outside loadable It works fine.
But when I am trying return

I am on it. Just cant merge and deploy anything at 00:06
React-Hot-Loader v4.9.0 should fix the issue.
@theKashey man you are THE BEST!!!. Thank you so much. Issue resolved
I should say - sorry for affecting you all by this issue for a few months...