taro icon indicating copy to clipboard operation
taro copied to clipboard

使用 @tarojs/[email protected] 创建项目,使用默认模板,build:alipay 构建支付宝小程序后,在小程序开发工具中打开,报错 Failed to compile, error[Parse]: Unexpected token

Open functionwell opened this issue 9 months ago • 2 comments

相关平台

支付宝小程序

小程序基础库: 2.0 使用框架: Vue 3

复现步骤

  1. 使用 @tarojs/[email protected] 创建项目,选择默认模板
  2. 安装依赖成功后,执行 build:alipay 构建支付宝小程序
  3. 在支付宝小程序开发工具中打开 dist 目录,出现报错
  4. 报错信息: Failed to compile, error[Parse]: Unexpected token

期望结果

taro 能正常构建生产环境的支付宝小程序

实际结果

taro 构建的生产环境的支付宝小程序无法使用

环境信息

taro info

👽 Taro v3.6.27


  Taro CLI 3.6.27 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 16.20.2 - ~\AppData\Local\fnm_multishells\21832_1714100665263\node.EXE
      npm: 8.19.4 - ~\AppData\Local\fnm_multishells\21832_1714100665263\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.27 => 3.6.27
      @tarojs/components: 3.6.27 => 3.6.27
      @tarojs/helper: 3.6.27 => 3.6.27
      @tarojs/plugin-framework-vue3: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-alipay: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-h5: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-jd: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-qq: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-swan: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-tt: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-weapp: 3.6.27 => 3.6.27
      @tarojs/runtime: 3.6.27 => 3.6.27
      @tarojs/shared: 3.6.27 => 3.6.27
      @tarojs/taro: 3.6.27 => 3.6.27
      @tarojs/taro-loader: 3.6.27 => 3.6.27
      @tarojs/webpack5-runner: 3.6.27 => 3.6.27
      babel-preset-taro: 3.6.27 => 3.6.27
      eslint-config-taro: 3.6.27 => 3.6.27

functionwell avatar Apr 26 '24 03:04 functionwell

+1 v3.6.28

qiaer avatar May 17 '24 08:05 qiaer

+1

v3.6.15

目前用这东西 撑着

chain.merge({ module: { rule: [ { test: /.js$/, loader: "babel-loader", }, ], }, });

hezhico avatar May 23 '24 02:05 hezhico

+1 "@tarojs/cli": "3.6.30" 版本,打包支付宝小程序,编译器无法通过编译。 image 支付宝开发者工具-项目-编译配置-转es5编译配置,设置成 “仅转换项目代码”,就没有报错了

meiqinLiu avatar Jun 03 '24 09:06 meiqinLiu