NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.57k stars 4.79k forks source link

快手小程序taro watch报错 #11507

Open bobsam opened 2 years ago

bobsam commented 2 years ago

相关平台

快手小程序

使用框架: React

复现步骤

执行命令: cross-env BUILD_ENV=development NODE_ENV=development taro build --type kwai --watch

然后出现报错:

offset_sourcemap_lines_1.default is not a function

(node:16909) UnhandledPromiseRejectionWarning: TypeError: offset_sourcemap_lines_1.default is not a function at TaroMiniPlugin.injectCommonStyles (/Users/bob/Documents/workspace/git.nie/a38-client-webfront/node_modules/@tarojs/mini-runner/src/plugins/MiniPlugin.ts:1189:43) at TaroMiniPlugin. (/Users/bob/Documents/workspace/git.nie/a38-client-webfront/node_modules/@tarojs/mini-runner/src/plugins/MiniPlugin.ts:1006:10) at Generator.next () at fulfilled (/Users/bob/Documents/workspace/git.nie/a38-client-webfront/node_modules/@tarojs/mini-runner/dist/plugins/MiniPlugin.js:5:58) (Use node --trace-warnings ... to show where the warning was created) (node:16909) 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:16909) [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.

期望结果

不报错,可以进行watch

实际结果

报错了,watch失败

环境信息

 Taro CLI 3.4.3 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.18.3 - /usr/local/bin/node
      Yarn: 1.22.4 - ~/.yarn/bin/yarn
      npm: 8.3.1 - /usr/local/bin/npm
    npmGlobalPackages:
      typescript: 4.6.3

补充信息

期望尽快修复,目前需要将现有的taro项目兼容快手。

github-actions[bot] commented 2 years ago

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

bobsam commented 2 years ago

https://github.com/NervJS/taro-plugin-platform-kwai/issues/16 同步在插件那边提了问题

skys215 commented 2 years ago

字节小程序同样报这个问题

skys215 commented 2 years ago

楼主是拿h5项目适配taro的吗?还是在从零开发中遇到的呢?

bobsam commented 2 years ago

目前是关闭了enableSourceMap配置就不会报错了。目测是mini-runner那边对快手的source map支持有问题。

bobsam commented 2 years ago

楼主是拿h5项目适配taro的吗?还是在从零开发中遇到的呢?

拿微信小程序版本适配。

AdvancedCat commented 2 years ago

已在 https://github.com/NervJS/taro-plugin-platform-kwai/issues/16 回复