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

具名导出组件时无法正确编译 #15075

Closed
diaz-zeng opened this issue Jan 6, 2024 · 1 comment
Closed

具名导出组件时无法正确编译 #15075

diaz-zeng opened this issue Jan 6, 2024 · 1 comment
Labels
F-react Framework - React resolved T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@diaz-zeng
Copy link

相关平台

H5

复现仓库

https://github.com/diaz-zeng/taro-issue.git
浏览器版本: Microsoft Edge 120 (MacOS ARM)
使用框架: React

复现步骤

1.切换到分支:bug-named-export

2.pnpm i & pnpm dev:h5

3.抛出异常:EvalError: $RefreshReg$ is not defined in/Users/bytedance/vscode_workspace/mobx-test/src/components/empty.tsx

期望结果

通过编译

实际结果

无法通过

环境信息

👽 Taro v3.6.22


  Taro CLI 3.6.22 environment info:
    System:
      OS: macOS 14.1.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 16.20.2 - ~/.nvm/versions/node/v16.20.2/bin/node
      Yarn: 1.22.19 - /opt/homebrew/bin/yarn
      npm: 8.19.4 - ~/.nvm/versions/node/v16.20.2/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.22 => 3.6.22 
      @tarojs/components: 3.6.22 => 3.6.22 
      @tarojs/helper: 3.6.22 => 3.6.22 
      @tarojs/plugin-framework-react: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-alipay: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-h5: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-jd: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-qq: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-swan: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-tt: 3.6.22 => 3.6.22 
      @tarojs/plugin-platform-weapp: 3.6.22 => 3.6.22 
      @tarojs/react: 3.6.22 => 3.6.22 
      @tarojs/runtime: 3.6.22 => 3.6.22 
      @tarojs/shared: 3.6.22 => 3.6.22 
      @tarojs/taro: 3.6.22 => 3.6.22 
      @tarojs/taro-loader: 3.6.22 => 3.6.22 
      @tarojs/webpack5-runner: 3.6.22 => 3.6.22 
      babel-preset-taro: 3.6.22 => 3.6.22 
      eslint-config-taro: 3.6.22 => 3.6.22 
      react: ^18.0.0 => 18.2.0 
      taro-ui: ^3.2.1 => 3.2.2 

@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Jan 6, 2024
@github-project-automation github-project-automation bot moved this to Padding in H5 Jan 6, 2024
@ZakaryCode
Copy link
Contributor

linaria 与 react 热更新冲突导致该错误抛出,可以参考 callstack/linaria#1308 新增 overrideContext 配置来跳过该问题

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

No branches or pull requests

2 participants