Skip to content

ky has conflicts with Next.js App Router #657

@Euruson

Description

@Euruson

Thanks for this excellent repo! I’m currently building my blog using Next.js with the App Router.

I ran into an issue where notion-client (specifically ky) fails to fetch data during build time—such as when using getCollectionData() inside a sitemap route or within a generateStaticParams() function. The request seems to hang indefinitely without returning data or throwing an error, and the browser page just keeps loading.

As a quick test, I replaced ky with the native fetch() API in notion-client, and the issue was resolved.

I’m not entirely sure why this happens—it might be related to how Next.js handles caching or fetch contexts during static generation. I’m also curious about the choice of ky in the codebase. Are there specific advanced features from ky that are being used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions