Skip to content

Conversation

mustaqimarifin
Copy link
Contributor

Description

Replaced KY with GOT

  • KY seems to loop infinitely in localhost for Next 15 bricking the entire session.
  • Latest version of GOT is a near 1:1 replacement

React Lazy Images

  • Very old dependencies and console warnings when using with NextJS
  • Lifted code from react-lazy-images and placed updated code and types in components/lazy-images-full.tsx
  • added react-intersection-observer and unionize

Notion Test Page ID

Can test with a local build of this fork with the examples in the monorepo.

Mustaqim Arifin and others added 2 commits June 26, 2025 19:57
1 - Replaced `KY` with `GOT` to address looping issues in NextJS
2 - Replaced `React-Lazy-Images` wtih Native Image Component
Copy link

vercel bot commented Jun 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
react-notion-x Error Error Sep 19, 2025 7:18am
react-notion-x-minimal-demo Error Error Sep 19, 2025 7:18am

@rimonhanna
Copy link
Contributor

rimonhanna commented Jun 28, 2025

@mustaqimarifin
Copy link
Contributor Author

mustaqimarifin commented Jun 30, 2025

@mustaqimarifin collections are no longer loading: react-notion-x-minimal-demo-5sgdlsrby-saasify.vercel.app/9cb9716c93164c6c8b4cd0bac3879aeb

i think the minimal demo doesn't import 'Collections', but the full demo does? Because the full demo does indeed load Collections on my end. Thx

Left: Current React-Notion-X Test Suite || Right: Localhost

s22.mp4

@rimonhanna
Copy link
Contributor

true, double checked and all good on the full example including my personal problematic page

@rimonhanna
Copy link
Contributor

@transitive-bullshit can we merge this too?

@rimonhanna
Copy link
Contributor

@transitive-bullshit kind reminder :)

@zsolteszku
Copy link

any update?

@transitive-bullshit
Copy link
Member

there are too many unrelated changes to merge this PR.

#653 was the main fix for collection issues

@transitive-bullshit
Copy link
Member

i'm really hesitant to switch from ky to got without understanding the underlying cause of the infinite loop bug which I haven't been able to repro

@mustaqimarifin
Copy link
Contributor Author

i'm really hesitant to switch from ky to got without understanding the underlying cause of the infinite loop bug which I haven't been able to repro

totally understand. tbf, i tested it with native fetch and it works just as well. I'm not sure whats causing KY to stall out..

@Euruson
Copy link
Contributor

Euruson commented Aug 5, 2025

I also met this problem with NextJS App Router.

#657 shows the details.

@mustaqimarifin
Copy link
Contributor Author

mustaqimarifin commented Aug 6, 2025

Hey guys,

Had some time and tested the various fetch packages out there and ofetch works pretty well with the latest react+next packages.

Got is comparatively huge vs ky or ofetch

Screenshot 2025-08-06 at 2 02 45 PM

Very few changes needed to use ofetch over ky

/*       kyOptions: {
        timeout: {
          request: 60_000
        },
        ...kyOptions,
        searchParams: {
          src: 'initial_load'
        }
      } */

      oFetchOptions: {
        timeout: 60_000,
        ...oFetchOptions,
        params: {
          src: 'initial_load'
        }
      }


   /* const res = await ky.post(url, {
      mode: 'no-cors',
      ...this._kyOptions,
      ...kyOptions,
      json: body,
      headers
    })
    return res.json<T>()
  } */

    const res = ofetch(url, {
      method: "POST",
      mode: 'no-cors',
      ...this._oFetchOptions,
      ...oFetchOptions,
      body,
      headers
    })
    return res

Let me know if this works for everyone.

…ocal dependencies. (Fix) Replace KY with OFetch. (Fix) Cleaned up unnceccesary and erroneous changes
@mustaqimarifin
Copy link
Contributor Author

there are too many unrelated changes to merge this PR.

#653 was the main fix for collection issues

Hi all @transitive-bullshit @rimonhanna @Euruson @zsolteszku ,

Yes, apologies for the messy PR. I've rebased the PR from the latest master with just the additions as originally intended.

Happy to help if possible.

@transitive-bullshit transitive-bullshit merged commit bf658b4 into NotionX:master Sep 19, 2025
0 of 2 checks passed
@transitive-bullshit
Copy link
Member

Thanks @mustaqimarifin 🙏

Will get a version of this released soon.

Should fix #657 and possibly #665 cc @tomcerdeira

@transitive-bullshit transitive-bullshit changed the title fix::notion-client - Replace ky with got || fix::react-notion-x - LazyImageFull.tsx updated fix::notion-client - Replace ky with ofetch || fix::react-notion-x - LazyImageFull.tsx updated Sep 19, 2025
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

Successfully merging this pull request may close these issues.

5 participants