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

Taro.env返回undefined 导致无法获取USER_DATA_PATH #7392

Closed
ILoveChy opened this issue Aug 20, 2020 · 2 comments · Fixed by #7884
Closed

Taro.env返回undefined 导致无法获取USER_DATA_PATH #7392

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

Comments

@ILoveChy
Copy link

相关平台

微信小程序

复现仓库

https://github.com/ILoveChy/issuesDemo
小程序基础库: 2.12.1
使用框架: React

复现步骤

随便一个地方输入Taro.env 都是undefined

期望结果

Taro.env可以获取到

实际结果

undefined

环境信息

Taro v3.0.7

Taro CLI 3.0.7 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.7.0 - D:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - D:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.14.7 - D:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 20, 2020
@Chen-jj Chen-jj added this to the 3.0.10 milestone Sep 3, 2020
@leo43555483
Copy link

这问题怎么解决?

@Chen-jj Chen-jj modified the milestones: 3.0.10, 3.0.11 Sep 10, 2020
@ZakaryCode ZakaryCode modified the milestones: 3.0.11, 3.0.12 Sep 18, 2020
@Mochen07
Copy link

更新Taro相关依赖 -> 暂时无法获取
使用wx.env.USER_DATA_PATH 无需任何引入直接编译可解决问题

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.

5 participants