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

运行 rcpress dev 启动后,访问主页报错 #36

Open
wind13 opened this issue Feb 22, 2021 · 4 comments
Open

运行 rcpress dev 启动后,访问主页报错 #36

wind13 opened this issue Feb 22, 2021 · 4 comments

Comments

@wind13
Copy link

wind13 commented Feb 22, 2021

从 antdsite 过来,很迷惑,建议把 antdsite 那边废弃 @deprecated 了。

安装了 rcpress 后,按"Get Started" 执行了一番,访问 localhost:3000,看到如下错误:

FAIL  TypeError: Cannot read property 'path' of undefined
    at /home/aaaa/node14/lib/node_modules/@rcpress/cli/node_modules/@rcpress/core/.temp/server/server-bundle.js:2277:14
@wangyi7099
Copy link
Member

好的👌🏻麻烦提供一下重新的此问题的demo

@wind13
Copy link
Author

wind13 commented Feb 23, 2021

怎么提供呢?我本地安装后运行就直接出现了问题。

@wangyi7099
Copy link
Member

因为我这边都是测试过没问题的 你把错误的代码放到github上就行 我下载下来看看

@eternallycyf
Copy link

全局脚手架貌似和别的包的版本冲突? 我的脚手架之前是dev 可以 , build 不行 一直请求超时, 梯子也不行

重新安装 node npm后
1.

目录:    ./docs/README.md   
命令:    rcpress dev
结果: 报错
Uncaught TypeError: Cannot read properties of undefined (reading 'path')
react-dom.development.js?68de:19528 The above error occurred in the <App> component:
    in App (created by HotExportedApp)
    in AppContainer (created by HotExportedApp)
    in HotExportedApp
    in Router (created by BrowserRouter)
    in BrowserRouter
React will try to recreate this component tree from scratch using the error boundary you provided, AppContainer.

命令    rcpress build
结果   可以使用

2.
目录 ./aaa/docs/README.md
          npm install @rcpress/cli
         并在package.json添加 
            "start": "rcpress dev docs",
            "build": "rcpress build docs"
命令 npm run start 
结果 可以使用
命令 npm run build
结果 可以使用

3.
  文件夹 内容  都依据2的结构 不变化
  此时在 文件夹根目录下
  rcpress dev docs   成功
  rcpress dev build   成功

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

3 participants