You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
loadable-components: module XXX is not found, client and server modules are not sync. You are probably not using the same resolver on server and client.
#796
Closed
mbrochh opened this issue
Oct 31, 2018
· 2 comments
EDIT: for possibly related issue in loadable-components repo see below
Hi all,
I recently updated my project to use loadable-components instead of react-loadable and I think I did all the changes as suggested by the with-loadable-components example in this repo..
It seemed to work fine at first, but I realised, whenever I change my files, the HMR works on the client-side, but when I refresh by browser, then it turns out that the server-rendered page is not in sync with that the client would generate.
This stuff is way over my head, so I'm not quite sure how to debug this.
First of all, I will double-check, that my repo has the same setup in server.js and client.js (and other files that might potentially be involved, like .babelrc etc) as the example.
Generally, I always wonder if these example repos are kept up to date as Razzle evolves? My hope is, that someone sees this issue here and also uses loadable-components with Razzle and knows an obvious fix that might not yet be in the example folder ;)
constapp=(<ApolloProviderclient={client}><BrowserRouter><App/></BrowserRouter></ApolloProvider>)// Load all components needed before renderingloadComponents().then(()=>{hydrate(app,document.getElementById('root'))})if(module.hot){module.hot.accept()}
Old issue. I can't remember if I changed anything or if loadable-components or Razzle came out with a newer version. But everything is working smoothly for me now with loadable-components.
EDIT: for possibly related issue in loadable-components repo see below
Hi all,
I recently updated my project to use loadable-components instead of react-loadable and I think I did all the changes as suggested by the
with-loadable-components
example in this repo..It seemed to work fine at first, but I realised, whenever I change my files, the HMR works on the client-side, but when I refresh by browser, then it turns out that the server-rendered page is not in sync with that the client would generate.
This stuff is way over my head, so I'm not quite sure how to debug this.
First of all, I will double-check, that my repo has the same setup in
server.js
andclient.js
(and other files that might potentially be involved, like .babelrc etc) as the example.Generally, I always wonder if these example repos are kept up to date as Razzle evolves? My hope is, that someone sees this issue here and also uses loadable-components with Razzle and knows an obvious fix that might not yet be in the example folder ;)
Here is my package.json:
Here is how I use loadable-components in
server.js
:And here is
client.js
:And of course
.babelrc
:Here is how I load and use components:
EDIT: I was pointed to this workaround in the loadable-components repo but that doesn't really solve the issue - it just happens less frequently
The text was updated successfully, but these errors were encountered: