rcpress
rcpress copied to clipboard
运行 rcpress dev 启动后,访问主页报错
从 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
好的👌🏻麻烦提供一下重新的此问题的demo
怎么提供呢?我本地安装后运行就直接出现了问题。
因为我这边都是测试过没问题的 你把错误的代码放到github上就行 我下载下来看看
全局脚手架貌似和别的包的版本冲突? 我的脚手架之前是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 成功