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_APP_ID不生效 #15009

Closed
CanonLs opened this issue Dec 20, 2023 · 2 comments · Fixed by #15427
Closed

设置TARO_APP_ID不生效 #15009

CanonLs opened this issue Dec 20, 2023 · 2 comments · Fixed by #15427
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@CanonLs
Copy link

CanonLs commented Dec 20, 2023

相关平台

微信小程序

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

复现步骤

项目根目录下有.env.dev文件 设置TARO_APP_ID=“(我的小程序id)” 构建过后dist/project.config.json的appid字段根本没有替换。
手动建立.env.development文件设置TARO_APP_ID 构建过后仍然不生效

期望结果

dist文件夹导入微信小程序自动识别appid

实际结果

无法识别
dist/project.config.json中appid字段的值仍然是touristappid

环境信息

Taro CLI 3.6.21 environment info:
    System:
      OS: macOS 12.7
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 21.4.0 - /usr/local/bin/node
      npm: 10.2.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.21 => 3.6.21 
      @tarojs/components: 3.6.21 => 3.6.21 
      @tarojs/helper: 3.6.21 => 3.6.21 
      @tarojs/plugin-framework-react: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-alipay: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-h5: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-jd: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-qq: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-swan: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-tt: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-weapp: 3.6.21 => 3.6.21 
      @tarojs/react: 3.6.21 => 3.6.21 
      @tarojs/runtime: 3.6.21 => 3.6.21 
      @tarojs/shared: 3.6.21 => 3.6.21 
      @tarojs/taro: 3.6.21 => 3.6.21 
      @tarojs/taro-loader: 3.6.21 => 3.6.21 
      @tarojs/webpack5-runner: 3.6.21 => 3.6.21 
      babel-preset-taro: 3.6.21 => 3.6.21 
      eslint-config-taro: 3.6.21 => 3.6.21 
      react: ^18.0.0 => 18.2.0 

补充信息

麻烦让文档清晰化

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Dec 20, 2023
@ZakaryCode
Copy link
Contributor

Duplicate of #14979

@ZakaryCode ZakaryCode marked this as a duplicate of #14979 Dec 21, 2023
@Madou-Shinni
Copy link

相关平台

微信小程序

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

复现步骤

项目根目录下有.env.dev文件 设置TARO_APP_ID=“(我的小程序id)” 构建过后dist/project.config.json的appid字段根本没有替换。 手动建立.env.development文件设置TARO_APP_ID 构建过后仍然不生效

期望结果

dist文件夹导入微信小程序自动识别appid

实际结果

无法识别 dist/project.config.json中appid字段的值仍然是touristappid

环境信息

Taro CLI 3.6.21 environment info:
    System:
      OS: macOS 12.7
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 21.4.0 - /usr/local/bin/node
      npm: 10.2.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.21 => 3.6.21 
      @tarojs/components: 3.6.21 => 3.6.21 
      @tarojs/helper: 3.6.21 => 3.6.21 
      @tarojs/plugin-framework-react: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-alipay: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-h5: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-jd: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-qq: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-swan: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-tt: 3.6.21 => 3.6.21 
      @tarojs/plugin-platform-weapp: 3.6.21 => 3.6.21 
      @tarojs/react: 3.6.21 => 3.6.21 
      @tarojs/runtime: 3.6.21 => 3.6.21 
      @tarojs/shared: 3.6.21 => 3.6.21 
      @tarojs/taro: 3.6.21 => 3.6.21 
      @tarojs/taro-loader: 3.6.21 => 3.6.21 
      @tarojs/webpack5-runner: 3.6.21 => 3.6.21 
      babel-preset-taro: 3.6.21 => 3.6.21 
      eslint-config-taro: 3.6.21 => 3.6.21 
      react: ^18.0.0 => 18.2.0 

补充信息

麻烦让文档清晰化

#14979 看看我的回答是否帮助到了你 #14979 (comment)

@ZEJIA-LIU ZEJIA-LIU changed the title 你们这个文档真的我吐了。设置TARO_APP_ID不生效 设置TARO_APP_ID不生效 Mar 18, 2024
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
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants