Comments (15)
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 up
from nextjs-notion-starter-kit.
Okay, a few common causes of this:
- Your URL is set to the wrong address in
site.config.js
- Your deployed API function is set to
isPreviewImageSupportEnabled: false
- ?? not sure if in build the localhost:3000/api/generate works??
A few quick fixes:
- set
isPreviewImageSupportEnabled: true
- comment out lines 48-50 of
notion.ts
(the image stuff) - deploy it
Then after that deployment finishes,
- uncomment out lines 48-50
- set the site domain in
site.config.js
to the output of your Vercel build (e.g. blog-drab-alpha.vercel.app) - deploy again
That path fixed everything for me. Am going to look further into the root cause later.
from nextjs-notion-starter-kit.
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.
from nextjs-notion-starter-kit.
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.build
file (maybe also a .env
file which is what I do), and then run vercel dev
, does it work for you locally?
My advice is to try getting the preview images working locally before deploying to vercel.
from nextjs-notion-starter-kit.
If you're on macOS, you can run:
cat my-google-application-credentials-file.json | base64 | pbcopy
And the result will be in your clipboard.
from nextjs-notion-starter-kit.
I'm also getting:
00:02:24.382 | page error xxx.yyy HTTPError: Response code 418 (I'm a Teapot)
-- | --
00:02:24.382 | at Request.<anonymous> (/vercel/workpath2/node_modules/got/dist/source/as-promise/index.js:117:42)
00:02:24.383 | at processTicksAndRejections (internal/process/task_queues.js:93:5) {
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 JSON
So the 418 error is caused by another problem, I guess.
from nextjs-notion-starter-kit.
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.
from nextjs-notion-starter-kit.
The 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.
from nextjs-notion-starter-kit.
I ran it locally by vercel dev
and it turned it a 404 Error
? Do you know what's wrong?
I've turned the domain into localhost
from nextjs-notion-starter-kit.
I post request manually, the response is success.
ps: But vercel dev
mode, it doesn't work.
Update: I guess the server render step, the api server is not running yet?
I ran it locally by
vercel dev
and it turned it a404 Error
? Do you know what's wrong?I've turned the domain into
localhost
from nextjs-notion-starter-kit.
Hello @transitive-bullshit I am getting Firebase config error: invalid "GOOGLE_APPLICATION_CREDENTIALS" should be base64-encoded JSON
Did you have any guide to how to configure one.
Thank you in Advance.
from nextjs-notion-starter-kit.
Hi @dbredvick, Thank you for your response.
I have tried to follow your steps but it is still not working for me. I have provided the vercel for debugging.
vercel_deploy_logs.txt
Hope it helps.
from nextjs-notion-starter-kit.
Did anyone figure out a way around this? I'm also using a custom domain and when I run locally I'm getting the same 404 error and when deploying getting the teapot error
from nextjs-notion-starter-kit.
@Tirth27
Hi, it was helpful for me to find this instruction for getting Gcloud service credentials, not Firebase config object ⇾ https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account
@transitive-bullshit
I can add this link to README file
But when I solved the first problem, I faced with "status 418" error, and when I downgraded to node 12 then I get "Error occurred prerendering page" on pages with custom URLs from site.config.
So I don't know what to do to fix image previews 🤷♂️
from nextjs-notion-starter-kit.
This message was prepared with the help of a translator, so I apologize in advance.
Firstly, I considered it right to wrap firebase API calls in a try catch construct (ib/get-preview-images.ts 21-24, 30)
Then the api/create-preview-image call was also wrapped in a try catch to get results and filter out nullable
This already solves the build problem if some image didn't load in firebase.
In the future, I plan to stop calling /api/create-preview-image. Since it requires an upstream server, it causes errors if the build runs on the same port.
Instead, 'create-preview-image' should be moved to lib and call the firebase API from there to load the image
from nextjs-notion-starter-kit.
Related Issues (20)
- External Link Preview fails: google drive link HOT 1
- Error: Something went wrong installing the "sharp" module HOT 6
- to Lower Case error
- Continuous Build and Deployment Challenges in Next.js Notion Project
- Limit fetch to teamspace or rootNotionPageId children HOT 4
- Discourse as Comment System
- Is there any possible method that it can display 2 different gallery in blog page & the tag can be link
- How to add TOC in the mobile phone
- Multilingual per post instead of per site?
- Is it possible to generate OGP Image that the size lower than 1MB? HOT 1
- 45 Minute
- Even non-existent pages return 200 OK http status code
- How to display the time create by "Date or reminder"?
- Bug: Publish date on website homepage is one month earlier than specified in Notion database, when it is set to be the first day of any month HOT 2
- After using Vervel to build, the Search function fails
- AWS Amplify has an error in deployment HOT 3
- Fix Font size
- Configure site.config.ts with env variables
- [Question] Og image is empty when sharing url link
- Clicking on search causes an Internal Server Error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextjs-notion-starter-kit.