nextjs-notion-starter-kit: HTTPError: Response code 418 (I'm a Teapot)
I want to enable preview image support, so I set up my firebase. But when I was deploying, Vercel told me
page load error {
--
11:18:07.713 | pageId: '123b34e0-320e-42a8-b02e-3af7553a2bbc',
11:18:07.713 | spaceId: 'f225ce83-48e1-4217-8126-c47ff80789dc'
11:18:07.713 | } HTTPError: Response code 418 (I'm a Teapot)
11:18:07.713 | at Request.<anonymous> (/vercel/workpath3/node_modules/got/dist/source/as-promise/index.js:117:42)
11:18:07.713 | at processTicksAndRejections (internal/process/task_queues.js:97:5) {
11:18:07.713 | code: undefined,
11:18:07.713 | timings: {
11:18:07.713 | start: 1612408687533,
11:18:07.713 | socket: 1612408687534,
11:18:07.713 | lookup: 1612408687558,
11:18:07.713 | connect: 1612408687569,
11:18:07.713 | secureConnect: 1612408687595,
11:18:07.713 | upload: 1612408687595,
11:18:07.713 | response: 1612408687710,
11:18:07.713 | end: 1612408687710,
11:18:07.713 | error: undefined,
11:18:07.713 | abort: undefined,
11:18:07.713 | phases: {
11:18:07.713 | wait: 1,
11:18:07.713 | dns: 24,
11:18:07.713 | tcp: 11,
11:18:07.713 | tls: 26,
11:18:07.713 | request: 0,
11:18:07.713 | firstByte: 115,
11:18:07.713 | download: 0,
11:18:07.714 | total: 177
11:18:07.714 | }
11:18:07.714 | }
11:18:07.714 | }
When I disabled the preview image support, it went back to normal.
This is the content in vercel.json

Here is the information from firestore

This is the firestore rule:

Do you know what is wrong?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (3 by maintainers)
Commits related to this issue
- Support Equations (#42) Added support for LaTeX equations using KaTeX. Equations can be either blocks or inline. — committed to qbbang/nextjs-notion-starter-kit by QuietRocket 4 years ago
Hello @yanyanlongxia @Tirth27. In my case, it’s returning 418 error because the Node.js version in Vercel is 14.x. After going to the Vercel’s project setting, change Node.js version to 12.x, the error disappears and preview image support works flawlessly.
Okay, a few common causes of this:
site.config.jsisPreviewImageSupportEnabled: falseA few quick fixes:
isPreviewImageSupportEnabled: truenotion.ts(the image stuff)Then after that deployment finishes,
site.config.jsto the output of your Vercel build (e.g. blog-drab-alpha.vercel.app)That path fixed everything for me. Am going to look further into the root cause later.
Also, after I disabled preview image support, it went back to normal.
There is also an error message
Error! Failed to complete request to /_next/webpack-hmr?page=%2F: Error: socket hang upThe latest version has switched to using a much simpler approach for image caching, and this API route no longer exists.
Please upgrade to the latest to fix this issue.
it look like about custom domain.when i remove my domain in Vercel, everything ok !! If i use my domain will get 418. if i use my domain in Vercel but set vercel’s domain in .site.config will get 500. After a few attempts, i think need change Node.js version to 12.x and set vercel’s domain in .site.config.
I’m also getting:
My token json file is base64 encoded and correct. If I mistype it, I receive:
Firebase config error: invalid "GOOGLE_APPLICATION_CREDENTIALS" should be base64-encoded JSONSo the 418 error is caused by another problem, I guess.
If you’re on macOS, you can run:
And the result will be in your clipboard.
I think this error is coming from here: https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/main/api/create-preview-image.ts#L19
If you add your env variables into a local
.env.buildfile (maybe also a.envfile which is what I do), and then runvercel dev, does it work for you locally?My advice is to try getting the preview images working locally before deploying to vercel.