click-ui icon indicating copy to clipboard operation
click-ui copied to clipboard

ReactCurrentDispatcher error - Issue using NextJS 15 / React 19

Open lio-p opened this issue 10 months ago • 0 comments

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.

lio-p avatar Apr 14 '25 12:04 lio-p