Skip to content

[Bug]: 使用自定义tabbar后,h5页面白屏 #17699

@lqzerogg

Description

@lqzerogg

相关平台

h5

小程序基础库版本

h5版本的问题,不涉及小程序

使用框架

React

问题描述

使用了自定义tabbar之后,编译成h5的时候页面白屏,但是编译成小程序的时候是正常的。

复现链接

https://github.com/lqzerogg/tarocozedemo/tree/feature-tabbar

复现步骤

重现步骤:
0. 安装依赖

  1. pnpm dev:weapp, 页面正常
  2. 取消,pnpm dev:h5, 页面白屏
  3. 取消,注释掉app.config.ts后,页面正常
export default defineAppConfig({
  pages: [
    'pages/index/index',
    'pages/test/index',
  ],
  window: {
    backgroundTextStyle: 'light',
    navigationBarBackgroundColor: '#fff',
    navigationBarTitleText: 'WeChat',
    navigationBarTextStyle: 'black'
  },
  // tabBar: {
  //   custom: true,
  //   // color: '#000000',
  //   // selectedColor: '#000000',
  //   // backgroundColor: '#000000',
  //   list: [
  //     {
  //       pagePath: 'pages/index/index',
  //       text: '列表',
  //     },
  //     {
  //       pagePath: 'pages/test/index',
  //       text: '测试',
  //     },
  //   ],
  // },
})

环境信息

Taro v4.0.4


  Taro CLI 4.0.4 environment info:
    System:
      OS: macOS 15.3.2
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 23.10.0 - ~/.nvm/versions/node/v23.10.0/bin/node
      npm: 10.9.2 - ~/.nvm/versions/node/v23.10.0/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.4 => 4.0.4 
      @tarojs/components: 4.0.4 => 4.0.4 
      @tarojs/helper: 4.0.4 => 4.0.4 
      @tarojs/plugin-framework-react: 4.0.4 => 4.0.4 
      @tarojs/plugin-html: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-alipay: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-h5: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-jd: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-qq: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-swan: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-tt: 4.0.4 => 4.0.4 
      @tarojs/plugin-platform-weapp: 4.0.4 => 4.0.4 
      @tarojs/react: 4.0.4 => 4.0.4 
      @tarojs/runtime: 4.0.4 => 4.0.4 
      @tarojs/shared: 4.0.4 => 4.0.4 
      @tarojs/taro: 4.0.4 => 4.0.4 
      @tarojs/taro-loader: 4.0.4 => 4.0.4 
      @tarojs/webpack5-runner: 4.0.4 => 4.0.4 
      babel-preset-taro: 4.0.4 => 4.0.4 
      eslint-config-taro: 4.0.4 => 4.0.4 
      react: ^18.0.0 => 18.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions