fidr / phoenix_live_react

Render React.js components in Phoenix LiveView views
MIT License
238 stars 42 forks source link

Live reload issue: `Uncaught Error: Cannot find module 'react-dom'` #8

Closed jamilabreu closed 3 years ago

jamilabreu commented 3 years ago

I'm periodically getting this error when editing the React component:

Uncaught Error: Cannot find module 'react-dom'

It goes away after restarting the server, but then comes back after editing the React component a few times (triggering a few live reloads).

Is there a way to prevent this?

I have the recommended code in my webpack config:

    resolve: {
      alias: {
        react: path.resolve(__dirname, "./node_modules/react"),
        "react-dom": path.resolve(__dirname, "./node_modules/react-dom"),
      },
    },
fidr commented 3 years ago

It doesn't seem related to this library

I'm not sure how you could solve that. You could try checking packages, webpack config, or live reload oddities.