react-refresh-webpack-plugin: Deprecation warnings failing Gatsby development server to start

Running gatsby develop fails with deprecations warnings traced to react-refresh-webpack-plugin (traced using node --trace-deprecation ./node_modules/gatsby/dist/bin/gatsby develop).

Error messages:

success Caching HTML renderer compilation - 0.006s

 ERROR 

(node:8481) [DEP_WEBPACK_MAIN_TEMPLATE_OUTPUT_OPTIONS] DeprecationWarning:
MainTemplate.outputOptions is deprecated (use Compilation.outputOptions instead)
    at /Users/me/project-root/web/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/i
ndex.js:134:60
    at Hook.eval (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_mod
ules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:104:1)
    at Hook.CALL_DELEGATE [as _call]
(/Users/me/project-root/web/node_modules/gatsby/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/Users/me/project-root/web/node_modules/gatsby/node_modul
es/webpack/lib/Compiler.js:1034:26)
    at /Users/me/project-root/web/node_modules/gatsby/node_modules/webpack/lib/Compiler.j
s:1076:29
    at Hook.eval [as callAsync] (eval at create (/Users/me/project-root/web/node_modules/
gatsby/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync]
(/Users/me/project-root/web/node_modules/gatsby/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/Users/me/project-root/web/node_modules/gatsby/node_modules/webp
ack/lib/Compiler.js:1071:28)
    at /Users/me/project-root/web/node_modules/gatsby/node_modules/webpack/lib/Watching.j
s:188:19
    at _next1 (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_module
s/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_modules/
tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)


 ERROR 

(node:8481) [DEP_WEBPACK_MAIN_TEMPLATE_REQUIRE] DeprecationWarning: MainTemplate.hooks.require
 is deprecated (use JavascriptModulesPlugin.getCompilationHooks().renderRequire instead)
    at /Users/me/project-root/web/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/i
ndex.js:135:52
    at Hook.eval (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_mod
ules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:104:1)
    at Hook.CALL_DELEGATE [as _call]
(/Users/me/project-root/web/node_modules/gatsby/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/Users/me/project-root/web/node_modules/gatsby/node_modul
es/webpack/lib/Compiler.js:1034:26)
    at /Users/me/project-root/web/node_modules/gatsby/node_modules/webpack/lib/Compiler.j
s:1076:29
    at Hook.eval [as callAsync] (eval at create (/Users/me/project-root/web/node_modules/
gatsby/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync]
(/Users/me/project-root/web/node_modules/gatsby/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/Users/me/project-root/web/node_modules/gatsby/node_modules/webp
ack/lib/Compiler.js:1071:28)
    at /Users/me/project-root/web/node_modules/gatsby/node_modules/webpack/lib/Watching.j
s:188:19
    at _next1 (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_module
s/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_modules/
tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)


 ERROR 

(node:8481) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning:
Compilation.hooks.normalModuleLoader was moved to
NormalModule.getCompilationHooks(compilation).loader
    at getNormalModuleLoader (/Users/me/project-root/web/node_modules/gatsby/node_modules
/webpack/lib/Compilation.js:383:39)
    at Object.get normalModuleLoader [as normalModuleLoader] (/Users/me/project-root/web/
node_modules/gatsby/node_modules/webpack/lib/Compilation.js:816:12)
    at /Users/me/project-root/web/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/i
ndex.js:212:31
    at Hook.eval (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_mod
ules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:104:1)
    at Hook.CALL_DELEGATE [as _call]
(/Users/me/project-root/web/node_modules/gatsby/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/Users/me/project-root/web/node_modules/gatsby/node_modul
es/webpack/lib/Compiler.js:1034:26)
    at /Users/me/project-root/web/node_modules/gatsby/node_modules/webpack/lib/Compiler.j
s:1076:29
    at Hook.eval [as callAsync] (eval at create (/Users/me/project-root/web/node_modules/
gatsby/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync]
(/Users/me/project-root/web/node_modules/gatsby/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.compile (/Users/me/project-root/web/node_modules/gatsby/node_modules/webp
ack/lib/Compiler.js:1071:28)
    at /Users/me/project-root/web/node_modules/gatsby/node_modules/webpack/lib/Watching.j
s:188:19
    at _next1 (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_module
s/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/Users/me/project-root/web/node_modules/gatsby/node_modules/
tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Output from gatsby info:

  System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.16.0 - ~/.nvm/versions/node/v14.17.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 91.0.4472.77
    Firefox: 86.0.1
    Safari: 14.1.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

We are talking about this privately at the moment, but when there is something to share I’ll update here.

I’m also going to output a warning instead of making the socket throw so at least the build would work but the overlay would probably not work as expected.

Hey! Thanks for reporting this issue - I am actually fully aware of this and have reached out to the maintainers of Gatsby so we can collaboratively get this fixed there 😄

Hi, please report to Gatsby instead of this plugin. They should have properly injected the WHM client instead of relying on us to provide a fallback, which in most cases are problematic.

I’ll fix the case where it is crashing and output a warning instead.

I guess you might have to do it in root since CRA also depends on a copy of this plugin …