我正在開發一個托管在 Vercel 上的 Gatsby 網站。它在本地運行良好,但是當我將其推送到 Vercel 時,構建中斷并顯示錯誤訊息"error An unexpected error occurred: "https://registry.yarnpkg.com/@user/dom/-/dom-0.0.11.tgz: Request failed \"404 Not Found\"".完整日志包含在下面。
當我第一次遇到錯誤時,確實缺少 src/pages/404.js 檔案。因此,我創建了它,作為標準功能組件,沒有特殊功能。
當我從開發版本 (localhost:8000/randomstring) 運行 404-preview 時,它顯示得很好。當我嘗試在本地構建它時gatsby build,它成功了:
│ └ /something/
└ src/pages/404.js
├ /404/
└ /404.html
我也嘗試從不同的帳戶創建新的 Vercel 專案,但結果相同。我沒有找到包含此問題的任何其他帖子。
這是完整的構建日志:
[16:16:00.967] Retrieving list of deployment files...
[16:16:02.582] Downloading 60 deployment files...
[16:16:04.867] Installing build runtime...
[16:16:06.018] Build runtime installed: 1.151s
[16:16:06.063] Installing build runtime...
[16:16:08.203] Build runtime installed: 2.139s
[16:16:09.140] Looking up build cache...
[16:16:09.351] Looking up build cache...
[16:16:09.622] Build Cache not found
[16:16:09.848] Build Cache not found
[16:16:09.957] Detected package.json
[16:16:09.958] Installing dependencies...
[16:16:10.305] yarn install v1.22.17
[16:16:10.437] [1/4] Resolving packages...
[16:16:10.490] Installing dependencies...
[16:16:11.187] [2/4] Fetching packages...
[16:16:13.099] error An unexpected error occurred: "https://registry.yarnpkg.com/@myverceluser/dom/-/dom-0.0.11.tgz: Request failed \"404 Not Found\"".
[16:16:13.100] info If you think this is a bug, please open a bug report with the information provided in "/vercel/path2/yarn-error.log".
[16:16:13.100] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[16:16:47.226] Error: Command "yarn install" exited with 1
[16:16:47.441] yarn install v1.22.17
[16:16:47.552] [1/4] Resolving packages...
[16:16:48.313] [2/4] Fetching packages...
[16:16:48.946] error An unexpected error occurred: "https://registry.yarnpkg.com/@myverceluser/utils/-/utils-0.0.5.tgz: Request failed \"404 Not Found\"".
[16:16:48.946] info If you think this is a bug, please open a bug report with the information provided in "/vercel/path1/yarn-error.log".
[16:16:48.947] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[16:16:49.494] Error: Command "yarn install" exited with 1
任何見解將不勝感激。如果我遺漏了一些重要資訊,請告訴我,我會添加它。
謝謝。
uj5u.com熱心網友回復:
我認為這不是您的 404 頁面丟失 - 框架不提供默認值嗎?
而是它無法獲取這個包,
% curl https://registry.yarnpkg.com/@user/dom/-/dom-0.0.11.tgz
{"error":"Not found"}
這是https://yarnpkg.com/package/dom嗎?那沒有版本 0.0.11。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/457652.html
下一篇:如何在qml中“滾動”滾動條?
