Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023/10/17/Fixed%20the%20broken%20search%20in%20nextjs-notion-starter-kit/ #20

Open
danni-cool opened this issue Nov 3, 2023 · 22 comments

Comments

@danni-cool
Copy link
Owner

danni-cool commented Nov 3, 2023

Fixed the broken search in nextjs-notion-starter-kit - Danni.cool - Daniel's Blog

If your nextjs-notion-starter-kit is v2.0.0 and broken in search

https://danni.cool/2023/10/17/Fixed%20the%20broken%20search%20in%20nextjs-notion-starter-kit/

Copy link

In your case, the correct command is 'yarn add patch-package

Copy link
Owner Author

@huiboxes exactly.

Copy link

thank u~it helps me a lot😃

@danni-cool
Copy link
Owner Author

@Juno65juno1 :)

Copy link

bluexg7 commented Jan 21, 2024

Good job ! And do you have article to introduce how to add comment function on this blog website?

Copy link
Owner Author

danni-cool commented Jan 21, 2024

@bluexg7 I don't have immediate plans to write about this, but I use https://github.com/krasimir/octomments on my website. Note that you'll still need additional development to integrate it fully with the Notion-Starter-Kit.

Copy link

Cuctut commented Mar 13, 2024

A super great article!! Thank you for your help!!
I want to know how to integrate this comment plugin like you do, because it doesn't seem to have a typescript version.

@danni-cool
Copy link
Owner Author

danni-cool commented Mar 13, 2024

@Cuctut JS works fine in a TS environment; just define a prop in tsconfig.json as "allowJs": true. What I did was clone all the files from octomments into the Notion-Starter-Kit and integrate it as a self-contained component. This provides you with ample operational flexibility.

  1. octomments requires creating GitHub issues to display your blog comments with your GitHub token, so you need to develop an additional API on the server side.
  2. When you render a new article, you should check if the article's comments exist. If not, use your created comments API from step 1 and write it to this Notion article's property.

Copy link

Cuctut commented Mar 14, 2024

@danni-cool I am a beginner in this field, and I know what you mean, but I don't know how to operate it specifically. TvT

@danni-cool danni-cool changed the title Comments Of the Post 《Fixed the broken search in nextjs-notion-starter-kit》 2023/10/17/Fixed%20the%20broken%20search%20in%20nextjs-notion-starter-kit/ May 6, 2024
Copy link
Owner Author

Hello everyone! I've decided to abandon the Next.js Notion starter kit for my website. Instead, I recommend trying out the solution of Notion + Elog + Hexo. It allows for easy DIY and offers better page speed. I'll write an article to introduce it next time!

Copy link

Hello @danni-cool, thank you for this guide! I am curious if you have moved to Notion + Elog + Hexo?

Copy link

Hi! I tried this and worked while running in dev mode. However it failed when deployed on Vercel. Any idea how to apply the patches? The build log said the patch applies though, however the search still error.

notion-client@6.15.6 ✔
Warning: patch-package detected a patch file version mismatch
  Don't worry! This is probably fine. The patch was still applied
  successfully. Here's the deets:
  Patch file created for
    notion-client@6.15.6
  applied to
    notion-client@6.16.0
  
  At path
  
    node_modules/notion-client
  This warning is just to give you a heads-up. There is a small chance of
  breakage even though the patch was applied successfully. Make sure the package
  still behaves like you expect (you wrote tests, right?) and then run
    patch-package notion-client
  to update the version in the patch file name and make this warning go away.

Copy link
Owner Author

@YesYouKenSpace Oh, I’m sorry for the delayed reply — it’s been a while since I noticed your message. I’d like to briefly explain the two main reasons why I stopped using the Notion Starter Kit:

  1. Notion Starter Kit is an all-in-one solution, which means that if I get bored with the current theme, it takes a lot of time to modify everything. In contrast, I find that using a blog generator with a theme preset offers more flexibility. This way, I can enhance the UI or apply plugins in just a few hours.

  2. While I agree that building sites with Vercel is awesome — since you don’t have to worry about many technical issues — blogs hosted on Vercel often suffer from poor page speed, especially in my region. Additionally, I noticed that the Notion Starter Kit doesn’t utilize caching effectively for images, which further slows down page performance. I believe that making everything static and hosting assets through a CDN leads to a better user experience.

With these considerations in mind, I now use Notion + Elog + Hexo to meet my needs.

Copy link
Owner Author

danni-cool commented Oct 23, 2024

@chandragie try to fix the version of "notion-client" in package.jsonand modify it to "notion-client" : "6.15.6", finally delete the node_modules dir and reinstall all the dependencies. hope it will be helpful to you.

@chandragie
Copy link

@chandragie try to fix the version of "notion-client" in package.jsonand modify it to "notion-client" : "6.15.6", finally delete the node_modules dir and reinstall all the dependencies. hope it will be helpful to you.

That's so weird. Mine is 6.15.6 already

@danni-cool
Copy link
Owner Author

Patch file created for
notion-client@6.15.6
applied to
notion-client@6.16.0

However, your log shows you are applying a patch that is prepared for notion-clinet@6.15.6 but finally applied to notion-client@6.16.0, I'm not sure 6.16.0 has any changes may conflict with the patch file.

Copy link

I found that Vercel need to specify modules name to patch.
So I changed the script to:

"postinstall": "patch-package notion-client",

However, this still doesn't work. Currently I got error 500 at sharp module:

Error: Could not load the "sharp" module using the linux-x64 runtime

Have been looking around for solutions but none work.

@danni-cool
Copy link
Owner Author

@chandragie
I don't have time to help figure out the detailed problem, but I can give you some ideas, try to checkout branch to some earlier branch hash in Notion-start-kit and repeat my patch step, it takes time to find the available version, maybe according to my comment time is an usable way.

Copy link

NVM, I got it working. Somehow sharp module can not be successfully installed only by relying on Git integration. I think something must be wrong with the install commands. I need to push it directly using Vercel CLI after installing your patch. Anyway, thanks

@danni-cool
Copy link
Owner Author

NVM

glad to hear that, good luck!

Copy link

Awesome, it works! Thanks a lot for sharing. 👍

Copy link

Hey ! I know this is a bit olde now, but I am running into dependency issues and problems with packages being out of date or functions being changed when using the next-js-starter-kit. Any change you're still interested in doing your tutorial / walkthrough of how you built this site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants