transitive-bullshit / nextjs-notion-starter-kit

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://transitivebullsh.it/nextjs-notion-starter-kit
MIT License
6.28k stars 5.29k forks source link

Clicking on search causes an Internal Server Error #618

Open nynevi opened 4 months ago

nynevi commented 4 months ago

Description

expected:

experienced:

Screenshot 2024-06-27 at 08 59 54

Notion Test Page ID

0191bcee9db04c3690b84062af8f12e2

nynevi commented 4 months ago

just fyi the searching will still not work. see my comment in the PR https://github.com/transitive-bullshit/nextjs-notion-starter-kit/pull/619#issue-2377316849

nynevi commented 4 months ago

for people trying to make searching work, react-notion-x version 6.16.1 has the fix https://github.com/NotionX/react-notion-x/compare/v6.16.0...v6.16.1#diff-730f034e11dd4199e0434acf6897a2b1cb0642641b160fd1c5be24753fda487eR552 but unfortunately it is not published to npm. latest on npm is 6.16.0 https://www.npmjs.com/package/react-notion-x I tried cloning react-notion-x and trying to build but ran into arm64 related issues of sharppackage.

I found an alternative https://github.com/ijjk/notion-blog but that also does not use official notion client https://www.npmjs.com/package/@notionhq/client I anticipate that notion-blog will have similar issues. I think it is best that we create our own nextjs application with notion's client

chandragie commented 2 weeks ago

Hey, this happened to me also on Vercel (production) for several days. I got it working now.

  1. Patch using @danni-cool method
  2. Build using next build and run next start. Test it in local.
  3. After confirming the search function is working, do deploy from local using vercel-cli (this is important)
  4. Run vercel deploy , it will trigger new deploy on Vercel. After the deployment done, test it using the assigned custom domain (search should work)
  5. Run vercel --prod to enable it to the main domain

I have no idea why the Vercel build by Git integration always gave me Uncaught Error: Could not load the "sharp" module using the linux-x64 runtime error. Building it from my local WSL machine and deploy it using CLI just works. 🙃