NervJS / taro

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

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

Open tingchow opened 5 days ago

tingchow commented 5 days ago

相关平台

H5

复现仓库

git@github.com: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