NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.79k stars 559 forks source link

Notion page render infinite loading with large workspace #210

Open seonglae opened 2 years ago

seonglae commented 2 years ago

Currently my notion page in on seongland.seongland.com/wiki which might move in future However, rendering this service do not work a few months ago by (p)npm build I'm not sure when is it, but build process do not complete like bottom screen shot.

image

My notion workspace has lots of pages. I think that's a big reason but I can't find the solution to render huge workspace by tuning concurerncy parameters. If there are some way to resolve this issue, I need help. I get stuck in this problem several months! thanks

repository is here

transitive-bullshit commented 2 years ago

Are you just calling new NotionAPI().getPage(pageId)? How are you invoking the API? Can you give an example page ID to test?

seonglae commented 2 years ago

Now I resolved this issue by ignore page by customize .getPage function with timeout option. (do not render page at build time) https://github.com/3bases/3trees/blob/aaf04504573ac3158c86c88f897675f5064f0f9c/lib/notion.ts

Notion sometimes do not response to request when I make a lot of API within a relatively short period. I thinks this is not an issue related to react-notion-x, but how about to add gotOption to getPage parameter?

transitive-bullshit commented 2 years ago

Yeah, I think adding the ability to override the timeout (and possibly other gotOption settings) would be great for getPage.