NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.61k stars 4.8k forks source link

3.6.29以后H5依赖预编译失败 #16101

Open lanzifeng118 opened 4 months ago

lanzifeng118 commented 4 months ago

相关平台

H5

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

复现步骤

期望结果

依赖预编译成功

实际结果

依赖预编译失败,已经为您跳过预编译步骤,但是编译速度可能会受到影响 ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.

环境信息

 Taro v3.6.33

  Taro CLI 3.6.33 environment info:
    System:
      OS: macOS 14.4.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v20.10.0/bin/yarn
      npm: 10.2.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.29 => 3.6.29 
      @tarojs/components: 3.6.29 => 3.6.29 
      @tarojs/helper: 3.6.29 => 3.6.29 
      @tarojs/plugin-framework-react: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-alipay: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-h5: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-jd: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-qq: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-swan: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-tt: 3.6.29 => 3.6.29 
      @tarojs/plugin-platform-weapp: 3.6.29 => 3.6.29 
      @tarojs/react: 3.6.29 => 3.6.29 
      @tarojs/runtime: 3.6.29 => 3.6.29 
      @tarojs/shared: 3.6.29 => 3.6.29 
      @tarojs/taro: 3.6.29 => 3.6.29 
      @tarojs/taro-loader: 3.6.29 => 3.6.29 
      @tarojs/webpack5-runner: 3.6.29 => 3.6.29 
      babel-preset-taro: 3.6.29 => 3.6.29 
      eslint-config-taro: 3.6.29 => 3.6.29 
      react: ^18.0.0 => 18.3.1 
CODESIDY commented 4 months ago

将src/index.html中的 <%= projectName %>改为 <%= htmlWebpackPlugin.options.title %>

lanzifeng118 commented 4 months ago

将src/index.html中的 <%= projectName %>改为 <%= htmlWebpackPlugin.options.title %>

不行呢

xiaodeji commented 4 months ago

开发环境: 在文件./config/dev.ts 添加一行 compiler: { type: "webpack5", prebunde: { enable: false, } }, 如: module.exports = { env: { NODE_ENV: '"development"' }, defineConstants: { }, compiler: { type: "webpack5", prebunde: { enable: false, } }, mini: {}, h5: {} }

izozo commented 3 months ago

请问你解决了吗,遇到同样的问题 taro v3.6.32 node v16.20.2

we125182 commented 2 months ago

@lanzifeng118 @izozo #15597 这个修复影响到了。试试把本地的webpack升级到5.90以上,config的h5配置加上这个

{
    h5: {
     ...
     output: {
      ...
      environment: {
        asyncFunction: true
      }
    },
}