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

getSystemInfoSync 不存在 #8450

Closed
yinLiangDream opened this issue Jan 5, 2021 · 2 comments
Closed

getSystemInfoSync 不存在 #8450

yinLiangDream opened this issue Jan 5, 2021 · 2 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@yinLiangDream
Copy link

相关平台

微信小程序

小程序基础库: 2.14.1
使用框架: React

复现步骤

直接调用

Taro.getSystemInfoSync().screenWidth / 750

期望结果

正常运行

实际结果

TypeError: Taro$1__default.getSystemInfoSync is not a function

环境信息

Taro v3.1.0-beta.4

  Taro CLI 3.1.0-beta.4 environment info:
    System:
      OS: macOS 11.2
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.19.0 - /usr/local/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.13.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: * => 3.0.6 
      @tarojs/components: ^3.1.0-beta.4 => 3.1.0-beta.4 
      @tarojs/mini-runner: ^3.1.0-beta.4 => 3.1.0-beta.4 
      @tarojs/react: ^3.1.0-beta.4 => 3.1.0-beta.4 
      @tarojs/router: * => 3.0.6 
      @tarojs/runtime: ^3.1.0-beta.4 => 3.1.0-beta.4 
      @tarojs/taro: ^3.1.0-beta.4 => 3.1.0-beta.4 
      @tarojs/webpack-runner: * => 3.0.6 
      babel-preset-taro: ^3.0.6 => 3.0.6 
      eslint-config-taro: * => 3.0.6 
      eslint-plugin-taro: * => 3.0.6 
      nerv-devtools: ^1.5.7 => 1.5.7 
      nervjs: ^1.5.7 => 1.5.7 
      react: ^16.14.0 => 16.14.0 
    npmGlobalPackages:
      typescript: 4.0.2

image
image

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Jan 5, 2021
@iSoftstone-HOS
Copy link

Taro版本问题,Taro3.0.21版本支持且保证保持 @tarojs/cli 的版本与各端依赖版本一致

@KenYuan1987
Copy link

打开package.json 检查一下是否所有@tarojs/xxx的库都是同一个版本,如果有不同的版本就统一成同一个版本,删掉node_modules,重新安装一下依赖,问题解决。

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

No branches or pull requests

4 participants