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

When used with react-hot-loader, async component gets stuck on the loader #84

Open
mikehdt opened this issue May 24, 2018 · 3 comments
Open

Comments

@mikehdt
Copy link

mikehdt commented May 24, 2018

It seems that maybe the latest version of react-hot-loader has some compatibility challenges.

Setting up a simple case using an ejected CRA project with react-hot-loader patched in (as per the docs from that project), and a structure that looks like this:

|- App (hot(module)(App) exported, imports Test1/Test1)
|- Test1
| |- Test1 (async export)
| |- RealTest1 (the actual component)

The Test1 loader code is pretty simple:

export default asyncComponent({
    resolve: () => import(/* webpackChunkName: "real-test-1" */ './RealTest1'),
    LoadingComponent: () => <div>Loading...</div>,
});

This works on initial render, however any changes to RealTest1 after the initial render result in the hot-reloaded async component only showing "Loading..." with no errors. It seems that perhaps the promise isn't resolving any more..?

I've had an initial poke around in the code, but haven't been able to turn up any leads as to why yet (guessing it might be promise related, or to do with the HMR chunk name from webpack?)

@mb8z
Copy link

mb8z commented May 25, 2018

I'm having the same exact problem. Did anyone solve this?

@Defmoves
Copy link

Defmoves commented Aug 9, 2018

Having the same problem too, anyone come across any solutions?

@houfeng0923
Copy link

maybe this explain and solution is helpful

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