We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
浏览器版本: chrome 84 使用框架: React 、typescript
config/index.js h5部分配置如下:
config/index.js
h5: { output: { filename: 'js/[name].js', chunkFilename: 'js/[name].[chunkhash:8].js', // publicPath: '/assets/', }, publicPath: '/', staticDirectory: 'static', esnextModules: ['taro-ui'], postcss: { autoprefixer: { enable: true, config: {}, }, cssModules: { enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]', }, }, }, miniCssExtractPluginOption: { filename: 'css/[name].[hash:8].css', chunkFilename: 'css/[name].[chunkhash:8].css', }, imageUrlLoaderOption: { limit: false, esModule: false, name: 'images/[name].[hash:8].[ext]', }, router: { mode: 'browser', customRoutes: { '/pages/index/index': '/home', '/pages/mine/index': '/personalcenter', }, }, },
http://localhost:8080/home
/personalcenter
Taro.redirectTo({url : '/pages/mine/index' })
Uncaught (in promise) Error: Route not found
http://localhost:8080/personalcenter
Taro.redirectTo({url : '/pages/mine/index' }) 正常跳转打开,并浏览器显示为http://localhost:8080/personalcenter
Taro CLI 3.0.7 environment info: System: OS: macOS 10.14.5 Shell: 3.2.57 - /bin/bash Binaries: Node: 12.16.1 - /usr/local/bin/node Yarn: 1.19.1 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm npmPackages: @tarojs/components: 3.0.7 => 3.0.7 @tarojs/mini-runner: 3.0.7 => 3.0.7 @tarojs/react: 3.0.7 => 3.0.7 @tarojs/runtime: 3.0.7 => 3.0.7 @tarojs/taro: 3.0.7 => 3.0.7 @tarojs/webpack-runner: 3.0.7 => 3.0.7 babel-preset-taro: 3.0.7 => 3.0.7 eslint-config-taro: 3.0.7 => 3.0.7 nervjs: ^1.5.7 => 1.5.7 react: 16.8.2 => 16.8.2 taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.3 npmGlobalPackages: typescript: 3.1.1
The text was updated successfully, but these errors were encountered:
升级至 3.0.8 试试
Sorry, something went wrong.
3.0.8可以了
luckyadam
No branches or pull requests
相关平台
H5
浏览器版本: chrome 84
使用框架: React 、typescript
复现步骤
config/index.js
h5部分配置如下:服务启动后,步骤:
http://localhost:8080/home
正常打开,/personalcenter
页,Taro.redirectTo({url : '/pages/mine/index' })
,Uncaught (in promise) Error: Route not found
,不会跳转成功http://localhost:8080/personalcenter
,正常期望结果
Taro.redirectTo({url : '/pages/mine/index' })
正常跳转打开,并浏览器显示为http://localhost:8080/personalcenter
实际结果
Uncaught (in promise) Error: Route not found
环境信息
补充官方文档说明:
The text was updated successfully, but these errors were encountered: