Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

接入百度统计sdk报错 #7415

Closed
janlycn opened this issue Aug 22, 2020 · 2 comments · Fixed by #7438
Closed

接入百度统计sdk报错 #7415

janlycn opened this issue Aug 22, 2020 · 2 comments · Fixed by #7438
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@janlycn
Copy link

janlycn commented Aug 22, 2020

相关平台

微信小程序

复现仓库

https://github.com/janlycn/taro-next-issue-project
小程序基础库: 2.10.4
使用框架: React

复现步骤

  1. 下载百度小程序 sdk 包
  2. 在 app.js 头部导入 sdk
  3. 编译运行
  4. 打开小程序即报错

期望结果

正常执行统计代码

实际结果

报错:
Cannot assign to read only property 'onShow' of object '#'

环境信息

👽 Taro v3.0.7


  Taro CLI 3.0.7 environment info:
    System:
      OS: macOS High Sierra 10.13.1
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.14.0 - ~/.nvm/versions/node/v10.14.0/bin/node
      Yarn: 1.12.3 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.14.0/bin/npm
    npmPackages:
      @tarojs/components: 3.0.7 => 3.0.7 
      @tarojs/mini-runner: 3.0.7 => 3.0.7 
      @tarojs/react: 3.0.7 => 3.0.7 
      @tarojs/runtime: 3.0.7 => 3.0.7 
      @tarojs/taro: 3.0.7 => 3.0.7 
      @tarojs/webpack-runner: 3.0.7 => 3.0.7 
      babel-preset-taro: 3.0.7 => 3.0.7 
      eslint-config-taro: 3.0.7 => 3.0.7 
      react: ^16.13.1 => 16.13.1 
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3 

补充信息

小程序App生命周期被设置为“只读”了,统计代码无法扩展生命周期;
查看 taro.js 代码发现,生命周期属性 writable 和 configurable 都为 false
image

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 22, 2020
@Chen-jj Chen-jj added this to the 3.0.9 milestone Aug 22, 2020
@shenghanqin
Copy link
Collaborator

俺也关心这个问题

@pdap
Copy link

pdap commented Aug 26, 2020

由于App生命周期被设置不可修改,友盟统计代码也遇到了类似的问题。。留个mark,持续关注直到修复。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants