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.

WHM support breaks projects that do not have it installed

See original GitHub issue

After upgrading to 0.2.0, I noticed the following error:

ERROR in ./node_modules/@pmmmwh/react-refresh-webpack-plugin/src/runtime/WHMEventSource.js
Module not found: Error: Can't resolve 'webpack-hot-middleware/client' in '[...]/node_modules/@pmmmwh/react-refresh-webpack-plugin/src/runtime'

I believe this is because webpack sees this require when bundling the injected runtime code:

https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/0a6c1149469718bb4b289fc0d6f370db78f84294/src/runtime/WHMEventSource.js#L7

And therefore tries to resolve and bundle that module. This code path isn’t taken when a WDS client has been injected, but webpack doesn’t know this at bundle time. My project doesn’t use WHM so that module doesn’t exist on my machine.

As a temporary workaround, installing WHM (npm i -D webpack-hot-middleware) fixes the issue.

/cc @blainekasten

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iassainovcommented, Apr 29, 2020

Still getting this issue while using webpack dev server 3.8.1.

Here are my dev-server options:

devServer: {
      contentBase: './dist',
      historyApiFallback: true,
      host: '0.0.0.0',
      port: 9002,
      overlay: {
         ....
      },
      proxy: {
         ....
      },
    },
1reaction
gaearoncommented, Mar 14, 2020

We could also make this an option, so the user can pass in which integration they are using, and we only load the runtime code for that integration (if they’re using something we don’t support, they could rock their own socket code as per #44 ).

This makes most sense to me. Don’t try to guess it on the client, but let the user pick one statically in config.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Quotas
Run the mount command without any arguments to obtain basic information about all your currently-mounted file systems.
Read more >
Troubleshoot Your Installation
This document describes how to troubleshoot problems with your cPanel & WHM installation.
Read more >
FIX FOR 'The last attempt to update cPanel & WHM was ...
Time by time, new features are added and it requires from space then the initial release. cPanel can reduce disk limit but it...
Read more >
Can i upgrade iptables on WHM server?
Hello, on my CentOS 6.x 64 openVZ based VPS where is WHM installed, i have "iptables -v": iptables v1.3.5 and i have Config...
Read more >
Allow users to install websites from version control
This .gitignore file is basically for cpanel stuff, you can add another to the public_html directory to ignore project files. Git supports multiple...
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