Skip to content
New issue

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

umi最新版本使用约定式路由404页面出不来,随便输入路由都是空白页面并未渲染404页面。 #5081

Closed
zevingao opened this issue Jul 23, 2020 · 4 comments
Assignees

Comments

@zevingao
Copy link

zevingao commented Jul 23, 2020

如题。
image
image
image

@xiaohuoni
Copy link
Member

bug,有相关的issues 和 PR的

@zhengmenghuang
Copy link

遇到相同的问题 demo 网站 https://llxhzm.xyz:6001

@lxzxl
Copy link

lxzxl commented Sep 10, 2020

鉴于迟迟没有合并PR, 提供本人的解决方法:

  1. 404.jsx 改成 [any].jsx, 保证在生成的路由在最后一项

  2. 覆盖页面属性的 pathundefined, 达到生成的routes里没有path的目的

// [any].jsx

const NoFoundPage = () => <div>not found</div>

// !!!这里覆盖掉 path 的值!!!
NoFoundPage.path = undefined;

export default NoFoundPage;

@xiaohuoni
Copy link
Member

相同问题#5092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants