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

初始化项目选择 vite 打包 h5 报错 #17278

Open
pie-dog opened this issue Feb 6, 2025 · 2 comments
Open

初始化项目选择 vite 打包 h5 报错 #17278

pie-dog opened this issue Feb 6, 2025 · 2 comments

Comments

@pie-dog
Copy link

pie-dog commented Feb 6, 2025

相关平台

H5

浏览器版本: Microsoft Edge126.0.2592.102 (正式版本) (64 位)
使用框架: React

复现步骤

Image Image

taro init myApp 运行该方法初始化一个项目, 选择 react , 不使用 TS, 编译为 ES5, 选择 Less, yarn, VIte, Gitee, 默认模版.
然后切换到项目文件 yarn 下载包, 再运行 build:h5 会报错:
[vite:legacy-post-process] [BABEL] unknown file: @babel/helper-compilation-targets: 'development' is not a valid target

  • Did you mean 'deno'? (While processing: "base$1")

期望结果

正常打包

实际结果

打包错误

环境信息

👽 Taro v4.0.9


  Taro CLI 4.0.9 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 18.16.1 - D:\daima\nodejs\node.EXE
      Yarn: 1.22.19 - D:\daima\nodejs\yarn.CMD
      npm: 9.5.1 - D:\daima\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.9 => 4.0.9
      @tarojs/components: 4.0.9 => 4.0.9
      @tarojs/helper: 4.0.9 => 4.0.9
      @tarojs/plugin-framework-react: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-alipay: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-h5: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-harmony-hybrid: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-jd: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-qq: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-swan: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-tt: 4.0.9 => 4.0.9
      @tarojs/plugin-platform-weapp: 4.0.9 => 4.0.9
      @tarojs/react: 4.0.9 => 4.0.9
      @tarojs/runtime: 4.0.9 => 4.0.9
      @tarojs/shared: 4.0.9 => 4.0.9
      @tarojs/taro: 4.0.9 => 4.0.9
      @tarojs/taro-loader: 4.0.9 => 4.0.9
      @tarojs/webpack5-runner: 4.0.9 => 4.0.9
      babel-preset-taro: 4.0.9 => 4.0.9
      eslint-config-taro: 4.0.9 => 4.0.9
      react: ^18.0.0 => 18.3.1
This was referenced Feb 8, 2025
@SourceKim
Copy link

使用 ts,也有这个问题

@ren-142326
Copy link

这是初始化项目就少依赖了,

Image

手动安装这个依赖就行,

这项目也不知道现在有人管没有

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants