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

🐛 [BUG] 根据文档使用脚手架创建的项目运行不了 #11338

Open
EasonQwQ opened this issue Sep 14, 2024 · 2 comments
Open

🐛 [BUG] 根据文档使用脚手架创建的项目运行不了 #11338

EasonQwQ opened this issue Sep 14, 2024 · 2 comments

Comments

@EasonQwQ
Copy link

EasonQwQ commented Sep 14, 2024

🐛 bug 描述

根据文档使用脚手架创建的项目运行不了

📷 复现步骤 | Recurrence steps

在windows和mac上按照文档运行启动步骤,都运行不起来。我的node版本是 v20.15.0

$ npm i @ant-design/pro-cli -g
$ pro create my-app


$ cd my-app
$ yarn
$ yarn start # 打开浏览器访问 http://localhost:8000

报错
image

🏞 期望结果 | Expected results

期望能正常打开

💻 复现代码 | Recurrence code

© 版本信息

  • Ant Design Pro 版本: [e.g. 4.0.0] 最新版本
  • umi 版本
  • 浏览器环境 chrome
  • 开发环境 [e.g. mac OS] mac os 和windows

🚑 其他信息

Uncaught Error: Absolute route path "/*" nested under path "/user" is not valid. An absolute child route path must start with the combined path of all its parent routes.
image

@EasonQwQ
Copy link
Author

已经2天了,我在mac和windows上都尝试了,node 也使用18以及20都尝试过

@wulianyougithub
Copy link

wulianyougithub commented Sep 14, 2024

修改routes.ts中的路由配置文件,这个错误提示说明,在路由配置中,试图在父路径 /user 下嵌套一个绝对路径 "/*",这是不被允许的。在 React Router(或其他类似的路由库)中,子路由的路径应相对于父路径,而不是绝对路径,把"/*"改成“*”或者注释掉,注释掉应该对整体没有影响,全局下有一个捕捉404的页面

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

No branches or pull requests

2 participants