NervJS / taro

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

vue 3.1.2 报 `TypeError: insertionPoint.insertAdjacentHTML is not a function` #9595

Closed b2nil closed 3 years ago

b2nil commented 3 years ago

相关平台

所有小程序

小程序基础库: 2.17.3 使用框架: Vue 3

复现步骤

  1. 新建一个 vue3 项目
  2. 安装依赖并将 vue 更新至 3.1.2
  3. pages/index/index.tstemplate 下的代码替换成如下代码,然后运行 yarn dev:weapp
    <view class="question">
    <view>每日一问</view>
    <view>平庸的过一生会遗憾吗?</view>
    <view class="question-content">
      <view class="question-content-process">
        <view class="question-content-process-left">
          能
        </view >
        <view class="question-content-process-right">
          不能
        </view>
      </view>
    </view>
    </view>
  4. 用小程序开发工具打开项目,即可看到错误信息

期望结果

小程序正常运行

实际结果

[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next 
  at <SwiperDemo tid="pages/index/index?$taroTimestamp=1624461341677" > 

._node_modules_@vue_runtime-dom_dist_runtime-dom.esm-bundler.js:94 Uncaught (in promise) TypeError: insertionPoint.insertAdjacentHTML is not a function

环境信息

 Taro CLI 3.3.0-alpha.2 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.16.1 
      Yarn: 1.22.10
      npm: 6.14.12

补充信息

First reported by @wcx929 here

Chen-jj commented 3 years ago

@b2nil 666~CI 挂了需要修复下哈,另外 insertAdjacentHTML 函数头部麻烦注释一下为了适配 Vue3 哈,之后会把这些非通用的 DOM API 以插件形式拆出去

b2nil commented 3 years ago

@Chen-jj 按照要求进行了修复,并注释。 但搞不懂为什么 node 13.x 的测试会挂掉一个。看了一下报错信息,好像跟这个 PR 没什么关系吧。