Home > Net >  Vercel won't build Gatsby site because of missing 404 page
Vercel won't build Gatsby site because of missing 404 page

Time:04-09

I'm working on a Gatsby site that's hosted on Vercel. It runs fine locally but when I push it to Vercel the build breaks with the error message "error An unexpected error occurred: "https://registry.yarnpkg.com/@user/dom/-/dom-0.0.11.tgz: Request failed \"404 Not Found\"". Full log is included below.

When I first encountered the error, the src/pages/404.js file was indeed missing. So therefore I created it, as a standard functional component, no special features.

When I run the 404-preview from the dev version (localhost:8000/randomstring) it shows up fine. And when I try building it locally gatsby build, it succeeds :

│ └   /something/
└ src/pages/404.js
  ├   /404/
  └   /404.html

I've tried creating new Vercel projects, also from a different account, with the same result. I've not found any other post containing this issue.

Here is the complete build log:

[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

Any insight would be deeply appreciated. Let me know if I've left some vital information out and I'll add it.

Thanks.

CodePudding user response:

I think it's not that your 404 page is missing - doesn't the framework provide a default?

But rather that it can't fetch this package,

% curl https://registry.yarnpkg.com/@user/dom/-/dom-0.0.11.tgz
{"error":"Not found"}

Is it this https://yarnpkg.com/package/dom? That doesn't have version 0.0.11.

  • Related