h5编译报错,TypeError: Cannot read property 'isWatch' of undefined



  • 编译报错内容
    (node:3152) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'isWatch' of undefined
    at Object.<anonymous> (C:\Users\shang\Desktop\theNeoTwo\theNeoTwo\node_modules@tarojs\webpack-runner\dist\index.js:99:16)
    at Generator.next (<anonymous>)
    at C:\Users\shang\Desktop\theNeoTwo\theNeoTwo\node_modules@tarojs\webpack-runner\dist\index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\shang\Desktop\theNeoTwo\theNeoTwo\node_modules@tarojs\webpack-runner\dist\index.js:3:12)
    at exports.default (C:\Users\shang\Desktop\theNeoTwo\theNeoTwo\node_modules@tarojs\webpack-runner\dist\index.js:98:40)
    at Compiler.<anonymous> (C:\Users\shang\AppData\Roaming\npm\node_modules@tarojs\cli\dist\h5\index.js:153:13)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\shang\AppData\Roaming\npm\node_modules@tarojs\cli\dist\h5\index.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    (node:3152) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was no
    t handled with .catch(). (rejection id: 1)
    (node:3152) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    两个同事用的mac编译h5没有出现这个问题,直接编译成功。我用的w10编译h5就会报这个错误,有没有大佬知道问题的原因在哪里



  • 我也遇到过该问题,跟平台系统没关系,我的也是mac。问题出现在taro的cli工具和项目的taro依赖版本没有对上,你检查一下你的cli版本,跟项目依赖的版本


登录后回复