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 项目若项目路径包含中文(非 ASCII 字符)则 pnpm 运行报找不到 @babel/plugin-proposal-decorators 依赖包错误 #16509

Open
skyclouds2001 opened this issue Sep 11, 2024 · 6 comments

Comments

@skyclouds2001
Copy link

skyclouds2001 commented Sep 11, 2024

相关平台

H5

复现仓库

https://github.com/skyclouds2001/taro-template-sky/tree/template-error-report
浏览器版本: Chrome 128
包管理器: pnpm 9.9.0
使用框架: React

复现步骤

  1. 运行 pnpm i 下载依赖
  2. 运行 pnpm dev:h5 运行项目

期望结果

项目能够正常运行

实际结果

项目运行中,终端及浏览器页面均报错
报错截图及具体报错信息参见仓库根目录下 report 目录

环境信息

  Taro CLI 4.0.5 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.11.0 - D:\Nodejs\node.EXE
      npm: 10.8.3 - D:\Nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.5 => 4.0.5
      @tarojs/components: 4.0.5 => 4.0.5
      @tarojs/helper: 4.0.5 => 4.0.5
      @tarojs/plugin-framework-react: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-alipay: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-h5: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-harmony-hybrid: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-jd: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-qq: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-swan: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-tt: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-weapp: 4.0.5 => 4.0.5
      @tarojs/react: 4.0.5 => 4.0.5
      @tarojs/runtime: 4.0.5 => 4.0.5
      @tarojs/shared: 4.0.5 => 4.0.5
      @tarojs/taro: 4.0.5 => 4.0.5
      @tarojs/vite-runner: 4.0.5 => 4.0.5
      babel-preset-taro: 4.0.5 => 4.0.5
      eslint-config-taro: 4.0.5 => 4.0.5
      react: ^18.0.0 => 18.3.1

补充信息

可能为项目使用中某个依赖包使用到 @babel/plugin-proposal-decorators 未安装
项目中手动安装 @babel/plugin-proposal-decorators 后不再报错,项目可正常运行

This was referenced Sep 14, 2024
@TheKonka
Copy link
Member

暂时不清楚原因,我这边正常没有报错

image

@skyclouds2001
Copy link
Author

skyclouds2001 commented Sep 15, 2024

暂时不清楚原因,我这边正常没有报错

image

神奇了,我从 https://github.com/skyclouds2001/taro-template-sky/tree/template-error-report 这边重新下了个版本,再按流程跑了一遍,居然没报错

我再研究一下

@skyclouds2001
Copy link
Author

skyclouds2001 commented Sep 15, 2024

应该是和项目所在路径有关,路径中含中文(非 ASCII 字符)会报错,不含就不会报错

D:\程序\taro-template-sky> pnpm dev:h5 运行报错

D:\chengxu\taro-template-sky> pnpm dev:h5 正常运行

@skyclouds2001

This comment was marked as outdated.

@skyclouds2001 skyclouds2001 changed the title 默认模板创建的 Taro 项目在 pnpm 环境中运行报找不到 @babel/plugin-proposal-decorators 依赖包错误 默认模板创建的 Taro 项目若项目路径包含中文则 pnpm 运行报找不到 @babel/plugin-proposal-decorators 依赖包错误 Sep 15, 2024
@skyclouds2001
Copy link
Author

很可能和项目模板中添加 @babel/plugin-proposal-class-properties 的原因类似,参见 5400d1f

@skyclouds2001 skyclouds2001 changed the title 默认模板创建的 Taro 项目若项目路径包含中文则 pnpm 运行报找不到 @babel/plugin-proposal-decorators 依赖包错误 默认模板创建的 Taro 项目若项目路径包含中文(非 ASCII 字符)则 pnpm 运行报找不到 @babel/plugin-proposal-decorators 依赖包错误 Sep 17, 2024
@zybieku
Copy link

zybieku commented Sep 18, 2024

+1
pnpm 依赖会报错
手动依赖 @babel/plugin-proposal-decorators 可以运行,但是会提示已经过期,需要升级
@babel/plugin-transform-class-xxx 之类的

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