Skip to content

ReactCurrentDispatcher error - Issue using NextJS 15 / React 19 #588

Open
@lio-p

Description

@lio-p

I tried using click-ui with the latest version of NextJS 15 and I'm getting this error when accessing the page.

 TypeError: Cannot read properties of undefined (reading 'ReactCurrentDispatcher')
    at (ssr)/./node_modules/@clickhouse/click-ui/dist/click-ui.es.js (.next/server/vendor-chunks/@clickhouse.js:20:1)
    at __webpack_require__ (.next/server/webpack-runtime.js:33:43)
    at eval (webpack-internal:///(ssr)/./components/Main.tsx:7:78)
    at (ssr)/./components/Main.tsx (.next/server/app/page.js:130:1)
    at Object.__webpack_require__ [as require] (.next/server/webpack-runtime.js:33:43) {
  digest: '38619909'
}

Steps to reproduce

  1. Create a new NextJS project: npx create-next-app@latest. Use defaults value for every question.
  2. Install click-ui and dependencies: yarn add @clickhouse/click-ui styled-components dayjs
  3. Add a Main.tsx component, and import it in page.tsx
"use client"
import { ClickUIProvider} from '@clickhouse/click-ui'

export default function Main() {  
    return (
         <ClickUIProvider theme={'dark'} >
            <div>Test</div>
        </ClickUIProvider>
    )
}
  1. Run the application: yarn dev

Application starts fine, but throws the error when loading the main page. Downgrading to NextJS 14 / React 18 fixes the issue.

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