ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.13k stars 8.12k forks source link

🐛 [BUG] Ant Design Pro 6 with Umi4 complete way to access browser failed #11248

Open YaEvan opened 1 month ago

YaEvan commented 1 month ago

🐛 bug 描述

Using the ant-design-pro pro-cli tool to generate a complete project exception, the page cannot be accessed through the browser

📷 复现步骤 | Recurrence steps

    npm i @ant-design/pro-cli -g
    DEBUG=pro-cli pro create myapp # 要全量的还是一个简单的脚手架? complete
    npm install yarn tyarn -g
    cd myapp && tyarn
    npm run dev

🏞 期望结果 | Expected results

Display the expected login page of ant-design-pro

💻 复现代码 | Recurrence code

src/.umi-test/core/route.tsx src/.umi/core/route.tsx

    "6": {"path": "/*", "parentId": "1", "id": "6"},
    "45": {"path": "/*", "parentId": "ant-design-pro-layout", "id": "45"},

Temporary fix

    "6": {"path": "*", "parentId": "1", "id": "6"},
    "45": {"path": "*", "parentId": "ant-design-pro-layout", "id": "45"},

© 版本信息

🚑 其他信息

Screenshot from 2024-06-03 15-30-54 Screenshot from 2024-06-03 15-19-53 Screenshot from 2024-06-03 15-20-13

After fix

Screenshot from 2024-06-03 15-46-02

Fettes commented 1 month ago

你路由写错了。 报错里面写了,子路由一定带父路由前缀。 比如

{
        path: '/user'
        routes: [
            {
                path: '/user/*/
             }
        ]
}
fatli commented 1 month ago

我也遇到这个问题了,没做任何修改。 $ npm i @ant-design/pro-cli -g $ pro create my-app

参考的官网上面的执行步骤 $ cd my-app $ yarn $ yarn start # 打开浏览器访问 http://localhost:8000 选择的是复杂示例