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

修改了h5配置的entry,编译后页面白屏 #17277

Open
hzeeli opened this issue Feb 6, 2025 · 1 comment
Open

修改了h5配置的entry,编译后页面白屏 #17277

hzeeli opened this issue Feb 6, 2025 · 1 comment

Comments

@hzeeli
Copy link

hzeeli commented Feb 6, 2025

相关平台

H5

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

复现步骤

配置文件:

// - config/index.ts

const baseConfig: UserConfigExport<'webpack5'> = {

// ...other code

h5: {
      entry: {
        app: `${path.resolve(__dirname, '../src/entry/app.tsx')}`
      }
    }
}

entry所在目录:

src

entry

app.tsx # 入口文件
app.config.ts #配置文件

官方demo做此简单修改可复现
附一个codesandbox代码

期望结果

期望能正确关联路由

实际结果

未正确渲染,白屏

环境信息

👽 Taro v4.0.9

  Taro CLI 4.0.9 environment info:
    System:
      OS: macOS 14.5
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.20.5 - /usr/local/bin/node
      Yarn: 1.22.22 - /usr/local/bin/yarn
      npm: 10.8.2 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.9 => 3.6.25 
      @tarojs/components: 4.0.9 => 3.6.25 
      @tarojs/helper: 4.0.9 => 3.6.25 
      @tarojs/plugin-framework-react: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-alipay: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-h5: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-jd: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-qq: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-swan: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-tt: 4.0.9 => 3.6.25 
      @tarojs/plugin-platform-weapp: 4.0.9 => 3.6.25 
      @tarojs/react: 4.0.9 => 3.6.25 
      @tarojs/runtime: 4.0.9 => 3.6.25 
      @tarojs/shared: 4.0.9 => 3.6.25 
      @tarojs/taro: 4.0.9 => 3.6.25 
      @tarojs/taro-loader: 4.0.9 => 3.6.25 
      @tarojs/webpack5-runner: 4.0.9 => 3.6.25 
      babel-preset-taro: 4.0.9 => 3.6.25 
      react: ^18.0.0 => 18.3.1 
    npmGlobalPackages:
      typescript: 5.4.5

补充信息

背景是想可以有多个app入口,脚本可选指定app打包。
微信小程序能跑通这个流程,但h5失败了

@hzeeli
Copy link
Author

hzeeli commented Feb 8, 2025

@ZakaryCode 大佬有空的话求帮忙解答下🙏

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

1 participant