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.

Hi,

I’m doing SSR with HMR, when trying to change lazy loaded component, the HMR works on client side, but when I tried to refresh the page, the console is showing these errors:

loadable-components.es.js:93 Uncaught Error: loadable-components: module "./NotFoundPage-1" is not found, client and server modules are not sync. You are probably not using the same resolver on server and client.
    at loadable-components.es.js:93
    at Array.map (<anonymous>)
    at loadState (loadable-components.es.js:87)
    at loadComponents (loadable-components.es.js:118)
    at Object.<anonymous> (client.js:25)
    at Object../src/renderer/client.js (app.js:1413)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object.0 (app.js:1982)
    at __webpack_require__ (bootstrap:772)
screen shot 2018-05-15 at 5 49 20 pm

How to Reproduce:

  1. Clone https://github.com/antonybudianto/react-ssr-starter
  2. npm i
  3. npm start
  4. Visit random 404 route (e.g http://localhost:3000/asdasd)
  5. Change src/routes/NotFoundPage/NotFoundPage.js
    • This route is lazy loaded
  6. Notice the hot reload should work
  7. Refresh the page
  8. Error shown

Any pointers will be helpful, thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
antonybudiantocommented, May 18, 2018

My current workaround is:

// on server
loadableState.getScriptTag().replace(/-\d+(?=")/g, '')

The idea is to remove the ending dash with index (“./NotFoundPage-1” -> “./NotFoundPage”), and error is gone 😄

2reactions
olehreznichenkocommented, May 15, 2018

Have the same issue 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

HMR not working on webpack 5.66.0 · Issue #15206 - GitHub
Hot module reloading is not working after updating webpack to v5.66.0. If the current behavior is a bug, please provide the steps to...
Read more >
webpack hot module replacement not working - Stack Overflow
it tries to update with HMR before trying to reload the whole page. So, presumably, if that fails, it will just reload the...
Read more >
Hot Module Replacement - webpack
Hot Module Replacement (HMR) exchanges, adds, or removes modules while an application is running, without a full reload. This can significantly speed up ......
Read more >
Hot Module Replacement - SurviveJS
Doing this pushes the problem to the application side. Enabling HMR#. The following steps need to be enabled for HMR to work: The...
Read more >
Hot Module Replacement (HMR) - Snowpack
hmr configuration option. Enable HMR: Custom Server#. Note: Full HMR is not yet supported. Only full page reloads are currently working. Follow updates...
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