umi
umi copied to clipboard
[Bug] 开发环境下firefox浏览器window.location.href无法正常跳转到新页面
What happens?
在config.ts中配置了routes之后,window.location.href开发环境下在firefox浏览器中并不会跳转到新地址,反而是刷新原来的地址
Mini Showcase Repository(REQUIRED)
Please provide a minimal reproduction then upload to your GitHub. 请提供 最小重现,并上传到你的 GitHub 仓库
https://github.com/jsxiaosi/umi-issues
export default function HomePage() {
return (
<div>
<button onClick={() => {
window.location.href = 'https://umijs.org/docs/guides/routes'
}
}>button</button>
</div>
);
}
How To Reproduce
Steps to reproduce the behavior: 1. 2.
Expected behavior 1. 2.
Context
- Umi Version:
- Node Version:
- Platform:
由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。
用 chrome 开发,构建完的产物生产环境是正常的。
这个问题我也遇到了,最终已解决:在package.json文件中命令添加cross-env HMR=none,火狐就可以正确跳转了