Repository: next.js
Issue: Error: ENOENT: no such file or directory, open '/vercel/path0/.next/server/pages/404.html'
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Node 16 - 18
React 17
Next 12.2


"dependencies": {
    "@apollo/client": "^3.4.13",
    "@emotion/react": "^11.10.5",
    "@next/bundle-analyzer": "^13.1.1",
    "@react-oauth/google": "^0.7.0",
    "@stripe/react-stripe-js": "^1.0.0",
    "@stripe/stripe-js": "^1.0.0",
    "axios": "^0.21.4",
    "dayjs": "^1.11.5",
    "dotenv": "^14.2.0",
    "final-form": "^4.20.7",
    "formik": "^2.2.9",
    "fs": "0.0.1-security",
    "imagekitio-react": "^2.0.0",
    "moment": "^2.29.4",
    "next": "^12.2.5",
    "next-i18next": "^12.0.0",
    "next-redux-wrapper": "^7.0.5",
    "next-sitemap": "^2.5.20",
    "node-fetch": "^3.2.3",
    "nprogress": "^0.2.0",
    "prop-types": "^15.8.1",
    "qs": "^6.11.0",
    "react": "17.0.2",
    "react-aria": "^3.21.0",
    "react-awesome-reveal": "^4.0.1",
    "react-dom": "17.0.2",
    "react-final-form": "^6.5.9",
    "react-icons": "^4.2.0",
    "react-infinite-scroll-component": "^6.1.0",
    "react-inner-image-zoom": "^3.0.0",
    "react-lazyload": "^3.2.0",
    "react-loading-overlay": "^1.0.1",
    "react-map-gl": "^6.1.17",
    "react-markdown": "^8.0.3",
    "react-moment": "^1.1.2",
    "react-multi-carousel": "^2.6.5",
    "react-places-autocomplete": "^7.3.0",
    "react-redux": "^7.1.0",
    "react-share": "^4.4.1",
    "react-simple-tooltip": "^2.6.3",
    "react-slick": "^0.28.1",
    "react-speech-recognition": "^3.9.0",
    "react-swipeable-views": "^0.14.0",
    "redux": "^4.1.1",
    "redux-devtools-extension": "^2.13.2",
    "redux-saga": "^1.1.3",
    "redux-thunk": "^2.4.0",
    "remark-gfm": "^3.0.1",
    "shortid": "^2.2.16",
    "slick-carousel": "^1.8.1",
    "styled-components": "latest",
    "swr": "^1.2.2",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.0",
    "eslint": "7.29.0",
    "eslint-config-next": "11.0.1",
    "file-loader": "^6.2.0",
    "googleapis": "^107.0.0",
    "lodash": "^4.17.21",
    "postcss": "^8.4.5",
    "react-datepicker": "^4.5.0",
    "sitemap": "^7.1.1",
    "tailwindcss": "^3.0.7"
  }
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

_No response_

### Link to the code that reproduces this issue or a replay of the bug

Can't link the project but I can shared package.json

### To Reproduce

Custom 404.js added
Node 16 and 18 used both gives the same error
React 17
Next 12.2

### Describe the Bug

This bug happens at the end of the build process during deployment on vercel, projects build but deployment fails due to 404.html not found error

### Expected Behavior

I did not change anything important on package.json or next-config.js or vercel project settings but recently this error started to occur on my projects that has 404.js as a custom 404 page.

### Which browser are you using? (if relevant)

any

### How are you deploying your application? (if relevant)

Vercel