-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
关于文档项目的site打包离线运行时,点击显示代码报错 #46544
Comments
我之前搞过一个 https://github.com/Wxh16144/antd-docker-docs 不过很久没更新了,你可以借鉴一下? |
看起来是 win 路径问题,需要去 dumi 解决这个问题 |
路径问题我记得之前 @PeachScript 提过, win 打包和 Unix 打包路径就会不一样。动态路由会有 |
v4版本我以前搞过,那时没这个问题 |
这个问题可以去 dumi 跟踪下,应该是 2.3.0-alpha 的相关问题 |
|
Trace umijs/dumi#1990 |
Reproduction link
https://github.com/CLXGGG/antd-web/blob/main/meta__E
Steps to reproduce
git clone antd的github上的文档项目,yarn 安装依赖,yarn site 打包,用nginx等运行工具跑起来。进入其中一个组件页面,点击显示代码。报错。
What is expected?
打包后离线运行能正常显示示例代码。
What is actually happening?
报错
ChunkLoadError: Loading chunk 98341 failed.
(error: http://localhost:8008/meta__E:__zh-CN.02244dde.async.js)
网上查找的打包antd离线文档方法都是用site打包。但是运行报错,我猜测是由于site打包后有的文件名命名成了“E:”这种格式,冒号":"是不能用来当文件名的,导致命名失败。重现链接是我site打包后的项目,命名失败文件名变成了“meta__E”。在任意一个组件页面中点击“查看代码”按钮时,会去找文件“meta__E:__zh-CN.02244dde.async.js",就报错了。
另外,本来想用github pages上运行这个项目的,但是运行后提供的链接在域名后加了个项目名:“/antd-web”,于是我配置了publicPath: './'和runtimePublicPath: {},大部分css等文件能访问到了,但还是有文件没改过来:“/dumi__tmp-production__dumi__theme__ContextWrapper.87193992.async.js”,访问它还是"/"而不是"./"相对路径。导致报错。github pages运行链接:https://clxggg.github.io/antd-web
The text was updated successfully, but these errors were encountered: