哇,还是不行,这是什么问题啊?



  • 编译 发现组件 src/components/mentorComp/mentorComp.jsxpromise rejection. This error originated either by throwing insi

    • 即将开始启动编译,请稍等~(node:13220) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'resource' of undefinedde process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs
      at D:\x-20200623\startupServicePlatform\node_modules_@tarojs_plugin-sass@2.1.0@@tarojs\plugin-sass\index.js:9:16
      at new Promise (<anonymous>)
      at compileSass (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_plugin-sass@2.1.0@@tarojs\plugin-sass\index.js:5:10)
      at Kernel.initPlugin (D:\x-20200623\node\node_global\node_modules@tarojs\cli\node_modules_@tarojs_service@2.2.9@@tarojs\service\dist\Kernel.js:117:16)
      at Kernel.resolvePlugins (D:\x-20200623\node\node_global\node_modules@tarojs\cli\node_modules_@tarojs_service@2.2.9@@tarojs\service\dist\Kernel.js:92:18)
      at Kernel.initPresetsAndPlugins (D:\x-20200623\node\node_global\node_modules@tarojs\cli\node_modules_@tarojs_service@2.2.9@@tarojs\service\dist\Kernel.js:80:14)
      at Kernel.<anonymous> (D:\x-20200623\node\node_global\node_modules@tarojs\cli\node_modules_@tarojs_service@2.2.9@@tarojs\service\dist\Kernel.js:40:18)
      at Generator.next (<anonymous>)
      at D:\x-20200623\node\node_global\node_modules@tarojs\cli\node_modules_@tarojs_service@2.2.9@@tarojs\service\dist\Kernel.js:8:71
      at new Promise (<anonymous>)
      (Use node --trace-warnings ... to show where the warning was created)
      (node:13220) 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 not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
      (node:13220) [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.
      ✅ 编译成功,请打开微信小程序开发者工具进行查看

    监听文件修改中...

    Cannot read property 'hooks' of undefined

    Cannot read property 'hooks' of undefined

    (node:13220) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hooks' of undefined
    at Watching.handler (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_mini-runner@2.1.0@@tarojs\mini-runner\dist\index.js:50:33)
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:99:9
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\x-20200623\startupServicePlatform\node_modules_tapable@1.1.3@tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (D:\x-20200623\startupServicePlatform\node_modules_tapable@1.1.3@tapable\lib\Hook.js:154:20)
    at Watching._done (D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:98:28)
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:73:19
    at Compiler.emitRecords (D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Compiler.js:499:39)
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Watching.js:54:20
    at D:\x-20200623\startupServicePlatform\node_modules_webpack@4.41.6@webpack\lib\Compiler.js:485:14
    at eval (eval at create (D:\x-20200623\startupServicePlatform\node_modules_tapable@1.1.3@tapable\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
    at MiniPlugin.<anonymous> (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_mini-runner@2.1.0@@tarojs\mini-runner\dist\plugins\MiniPlugin.js:107:17)
    at Generator.next (<anonymous>)
    at fulfilled (D:\x-20200623\startupServicePlatform\node_modules_@tarojs_mini-runner@2.1.0@@tarojs\mini-runner\dist\plugins\MiniPlugin.js:5:58)
    (node:13220) 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 not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

    D:\x-20200623\startupServicePlatform>



  • @不明飞行吻 同上问题 你解决了吗?



  • 不要 引入 react的hooks ,要引入taro的hooks
    如:import Taro, { Config, useState, useEffect } from '@tarojs/taro'



  • @jd_763895bfa159c 没有啊,没有引用过react的hooks的,这个错误是编译和自动热重载的时候报的错误,关于这方面,我没有改过



  • @生疼111 没有,自从端午之后就一直这样,在taro更新必须安装sass插件才能使用之后一直编译报错,无法热重载



  • 问题解决了吗,我也遇到了这个问题



  • 淦,我也是一样的问题,虽然不影响编译和运行但是看起来好烦啊



  • 539302bf-f681-42ee-ad37-d4bfd98f9e1b-image.png

    1. 首先 taro doctor 诊断下项目 看看有无配置问题
    2. 我把这config/index.js中两行配置去掉就好了


  • @jd_xHGmHytpvfUG 然而我config/index.js里并没有这两个插件 = =


登录后回复