React Native-Expo-WebPack热模块更换插件问题

我正在使用带有React-Native的Expo,并且在编辑文件时遇到问题。当它运行时,每次保存文件修改时,npm都会失败。 错误:

Compiling...

build [========            ] 40%TypeError: compilation.getPathWithInfo is not a function
    at /Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/@expo/webpack-config/node_modules/webpack/lib/HotModuleReplacementPlugin.js:309:23
    at SyncHook.eval (eval at create (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/HookCodeFactory.js:19:10),<anonymous>:16:1)
    at SyncHook.lazyCompileHook (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/Hook.js:154:20)
    at /Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/webpack/lib/Compilation.js:1361:37
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/HookCodeFactory.js:33:10),<anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/webpack/lib/Compilation.js:1304:27)
    at /Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/webpack/lib/Compiler.js:665:18
    at /Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/webpack/lib/Compilation.js:1224:4
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/HookCodeFactory.js:33:10),<anonymous>:20:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.finish (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/webpack/lib/Compilation.js:1216:28)
    at /Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/webpack/lib/Compiler.js:662:17
    at _done (eval at create (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/HookCodeFactory.js:33:10),<anonymous>:11:1)
    at eval (eval at create (/Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/tapable/lib/HookCodeFactory.js:33:10),<anonymous>:34:22)
    at /Users/Sebasbelaustegui/projects/web-cloudgaia/node_modules/react-dev-utils/ModuleNotFoundPlugin.js:114:15
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `expo start --web --dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Sebasbelaustegui/.npm/_logs/2019-11-25T20_47_40_668Z-debug.log

似乎HotModuleReplacementPlugin失败了。 我已经进行了博览会诊断,这就是我得到的:

Expo CLI 3.8.0 environment info:
System:
  OS: macOS 10.15.1
  Shell: 5.7.1 - /bin/zsh
Binaries:
  Node: 12.10.0 - /usr/local/bin/node
  Yarn: 1.17.3 - /usr/local/bin/yarn
  npm: 6.13.1 - /usr/local/bin/npm
IDEs:
  Android Studio: 3.5 AI-191.8026.42.35.5791312
  Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
  expo: ^35.0.0 => 35.0.1 
  react: 16.8.3 => 16.8.3 
  react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
npmGlobalPackages:
  expo-cli: 3.8.0

谢谢!

nb_sky 回答:React Native-Expo-WebPack热模块更换插件问题

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3033392.html

大家都在问