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.12k stars 5.21k forks source link

search function is not available #546

Open bluexg7 opened 1 year ago

bluexg7 commented 1 year ago

Description

search function is not available.

Error Details

error - HTTPError: Response code 400 (Bad Request) at Request. (/Users/guoxin/Workspace/JsProjects/my-blog/node_modules/notion-client/node_modules/got/dist/source/as-promise/index.js:117:42) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'ERR_NON_2XX_3XX_RESPONSE', timings: { start: 1694342767231, socket: 1694342767231, lookup: 1694342767248, connect: 1694342767521, secureConnect: 1694342767799, upload: 1694342767800, response: 1694342768142, end: 1694342768144, error: undefined, abort: undefined, phases: { wait: 0, dns: 17, tcp: 273, tls: 278, request: 1, firstByte: 342, download: 2, total: 913 } }, page: '/api/search-notion' }

suggestions

  1. Use official api [Recommend, if repo owner has some time😊] notion-client which is used in this repo is unofficial, here is official api, https://github.com/makenotion/notion-sdk-js

  2. Keep using private api, but need to do some replacement work search method in notion-client is outdated, I have try searching in notion.so, we should use "https://www.notion.so/api/v3/queryCollection?src=change_search" to replace "https://www.notion.so/api/v3/search".

Notion Test Page ID

danni-cool commented 11 months ago

@bluexg7 I fixed the problem temporarily, and wrote an article, if you are interested, here's the link. https://danni.cool/2023/10/17/Fixed%20the%20broken%20search%20in%20nextjs-notion-starter-kit/

tuan404 commented 11 months ago

Hello @danni-cool, it looks like the notion-client6.15.6.patch file is broken. Any chance you could shoot over another copy to tvtuan.404@gmail.com? Thanks a bunch in advance!

danni-cool commented 11 months ago

@tuan404 Thx for informing me, I tested the notion link, and it's working, I‘ve uploaded a copy on Google Drive: https://drive.google.com/file/d/17AQFkbqJVH53DGIKYGZBHGTH1w6Rgpzu/view

prgf87 commented 10 months ago

@danni-cool worked for me, thank you for the fix

bluexg7 commented 7 months ago

@danni-cool Thanks for your fix

dvitanov commented 7 months ago

Thank you for the fix @danni-cool

Divide-By-0 commented 5 months ago

I still have this issue on the latest fork of this repo.

iyongliang commented 5 months ago

@tuan404 Thx for informing me, I tested the notion link, and it's working, I‘ve uploaded a copy on Google Drive: https://drive.google.com/file/d/17AQFkbqJVH53DGIKYGZBHGTH1w6Rgpzu/view

worked for me, thank you. Add a pull/request for others?

danni-cool commented 5 months ago

@neeyongliang it was fixed in the dependency of react-notion-x@6.16.1, but the version in this repo was fixed to 6.15.6。I tried to upgrade it alone but there came other new problems. this is a minimal way to solve this problem.

yanyanlongxia commented 1 month ago

@bluexg7 I fixed the problem temporarily, and wrote an article, if you are interested, here's the link. https://danni.cool/2023/10/17/Fixed%20the%20broken%20search%20in%20nextjs-notion-starter-kit/

Worked for me. Thanks!