Taro v3.6.24 build H5 设置编译报错

olmpazwi  于 5个月前  发布在  其他
关注(0)|答案(3)|浏览(47)

相关平台

H5

浏览器版本: Chrome 116
使用框架: React

复现步骤

pnpm run dev 正常

pnpm run build 报错

期望结果

期望正常构建生成

实际结果

✖ Webpack
Compiled with some errors in 3.51m

✖ Errors:

Error: js/app.js from Terser plugin
str.replace is not a function
TypeError: str.replace is not a function
at Array.forEach ()

ELIFECYCLE  Command failed with exit code 1.

环境信息

👽 Taro v3.6.24

  Taro CLI 3.6.24 environment info:
    System:
      OS: Linux 5.4 Ubuntu 20.04.6 LTS (Focal Fossa)
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v18.13.0/bin/yarn
      npm: 9.6.5 - ~/.nvm/versions/node/v18.13.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.24 => 3.6.24 
      @tarojs/components: 3.6.24 => 3.6.24 
      @tarojs/helper: 3.6.24 => 3.6.24 
      @tarojs/plugin-framework-react: 3.6.24 => 3.6.24 
      @tarojs/plugin-html: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-alipay: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-h5: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-jd: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-qq: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-swan: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-tt: 3.6.24 => 3.6.24 
      @tarojs/plugin-platform-weapp: 3.6.24 => 3.6.24 
      @tarojs/react: 3.6.24 => 3.6.24 
      @tarojs/runtime: 3.6.24 => 3.6.24 
      @tarojs/shared: 3.6.24 => 3.6.24 
      @tarojs/taro: 3.6.24 => 3.6.24 
      @tarojs/taro-loader: 3.6.24 => 3.6.24 
      @tarojs/webpack5-runner: 3.6.24 => 3.6.24 
      babel-preset-taro: 3.6.24 => 3.6.24 
      eslint-config-taro: 3.6.24 => 3.6.24 
      react: ^18.0.0 => 18.2.0 
    npmGlobalPackages:
      typescript: 5.0.4
nmpmafwu

nmpmafwu1#

给个复现仓库看看

lnxxn5zx

lnxxn5zx2#

找到问题的原因了,跟 logto 不兼容 https://github.com/logto-io/logto

@TheKonka

5lhxktic

5lhxktic3#

你是怎么排出兼容依赖的,我错误跟你一样dev正常 build就出问题

相关问题