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

"@tarojs/webpack-runner": "3.1.4"依赖react-refresh报错 不允许自定义环境变量 #9576

Closed
CoquettishPoppy opened this issue Jun 21, 2021 · 5 comments
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@CoquettishPoppy
Copy link

CoquettishPoppy commented Jun 21, 2021

相关平台

H5

复现仓库

https://gitee.com/wanglugitee/repeat-bug.git
浏览器版本: 谷歌 版本 91.0.4472.77(正式版本) (x86_64)
使用框架: React

复现步骤

执行npm run dev:h5即可

期望结果

在不升级版本 或者降级版本的前提下 允许可以更改变量名

实际结果

使用cross-env NODE_ENV=dev自定义变量名 抛出异常 无法正常运行
报错图片
报错图片

环境信息

  Taro CLI 3.2.13 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.16.1 - /usr/local/bin/node
      Yarn: 1.22.10 - ~/.npm-global/bin/yarn
      npm: 7.15.0 - ~/.npm-global/bin/npm
    npmPackages:
      @tarojs/components: 3.1.4 => 3.1.4 
      @tarojs/mini-runner: 3.1.4 => 3.1.4 
      @tarojs/react: 3.1.4 => 3.1.4 
      @tarojs/runtime: 3.1.4 => 3.1.4 
      @tarojs/taro: 3.1.4 => 3.1.4 
      @tarojs/webpack-runner: 3.1.4 => 3.1.4 
      babel-preset-taro: 3.1.4 => 3.1.4 
      eslint-config-taro: 3.1.4 => 3.1.4 
      react: ^17.0.0 => 17.0.2 
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Jun 21, 2021
@CoquettishPoppy
Copy link
Author

跪求各位大佬麻烦看一下怎么解决这个问题😢

@Chen-jj
Copy link
Contributor

Chen-jj commented Jun 21, 2021

@CoquettishPoppy 参考这里关闭 Fast Refresh 试试

image

https://github.com/NervJS/taro/releases?after=v3.1.1

@CoquettishPoppy
Copy link
Author

@CoquettishPoppy 参考这里关闭 Fast Refresh 试试

image

https://github.com/NervJS/taro/releases?after=v3.1.1

解决了 谢谢大佬

@Chen-jj Chen-jj closed this as completed Oct 28, 2021
@mengyibo
Copy link

mengyibo commented Jan 6, 2022

如果不想关闭Fast Refresh,又想自定义环境变量名怎么办

@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
@aFcFzF
Copy link

aFcFzF commented May 5, 2023

我这俩都关闭了,但还会出热更新错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

4 participants