Skip to content

H5使用Taro.navigateTo,如果通过?携带参数,会报错 #16895

Open
@tingchow

Description

@tingchow

相关平台

H5

复现仓库

[email protected]:tingchow/mozi_wechatapp.git
浏览器版本: Chrome 130.0.6723.117
使用框架: React

复现步骤

  1. npm run dev:h5
  2. 使用Taro.navigateTo({
    url: /pages/detail/index?symbol=BTC,
    }); 需要有?拼接参数
  3. 无法跳转,提示
    errMsg
    :
    "navigateTo:fail page /pages/detail/index?symbol=BTC is not found"

期望结果

url携带参数可正常跳转

实际结果

携带参数无法跳转,并提示not found
image

环境信息

👽 Taro v3.6.29


  Taro CLI 3.6.29 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 16.20.2 - C:\Program Files\nodejs\node.EXE
      npm: 8.19.4 - C:\Program Files\nodejs\npm.CMD
    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-html: ^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

补充信息

微信小程序无问题,在H5模式下url携带参数无法跳转,不携带参数可正常跳转
Taro版本为3.6.29

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-reactFramework - ReactT-h5Target - 编译到 H5V-3Version - 3.x

    Type

    No type

    Projects

    Status

    Padding

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions