NervJS / taro

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

v4.0.0-beta.85 vite 官方模板 h5 dev 启动有问题,build 产物无法运行 #15848

Open skywalker512 opened 1 month ago

skywalker512 commented 1 month ago

相关平台

H5

浏览器版本: Google Chrome 125.0.6422.113 (正式版本) (x86_64) 使用框架: Vue 3

复现步骤

npm i -g @tarojs/cli@beta

选择 vue3 vite 模板

pnpm run dev:h5 pnpm run build:h5

期望结果

dev 正常运行,build 产物正常运行

实际结果

dev 报错 Vite Error, /@fs/data/co/taro-hy-2/node_modules/.vite/deps/chunk-ROME4SDB.h5.js?v=cd31ee89 optimized info should be defined

build 产物报错

Uncaught ReferenceError: Cannot access 'n' before initialization at common.b43f8f14.js:1:1411

环境信息

👽 Taro v4.0.0-beta.85

  Taro CLI 4.0.0-beta.85 environment info:
    System:
      OS: Linux 6.6
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v20.11.1/bin/yarn
      npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/components: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/helper: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-framework-vue3: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-html: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-alipay: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-h5: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-jd: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-qq: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-swan: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-tt: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/plugin-platform-weapp: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/runtime: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/shared: 4.0.0-beta.85 => 4.0.0-beta.85 
      @tarojs/taro: 4.0.0-beta.85 => 4.0.0-beta.85 
      babel-preset-taro: 4.0.0-beta.85 => 4.0.0-beta.85 
      eslint-config-taro: 4.0.0-beta.85 => 4.0.0-beta.85 
viewweiwu commented 2 weeks ago

可以帮忙看看吗?h5 官方模板都跑不起来呀

hatiwowo commented 1 week ago

同问,我是react vite模版,删除node_modules重新安装还是会报Vite Error, /@fs/Users/hatiwowo/Demo/lastDance/node_modules/.vite/deps/chunk-ROME4SDB.h5.js?v=7a8bd25e optimized info should be defined