Skip to content

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner' when chart is used in Next.js 15.3.4. #601

@obsicn

Description

@obsicn

Provide a general summary of the issue here

When react-spectrum-charts are used in Next.js 15.3.4., I faced following error. After I changed Next.js verison to 14.2.25, I solved the problem. I think the version of React is the root cause. Are there any plan for react-spectrum-charts to support React 19?

✓ Compiled / in 5.6s (11054 modules)
⨯ TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
at (ssr)/./node_modules/@adobe/react-spectrum-charts/dist/index.js (.next/server/vendor-chunks/@adobe.js:19:1)
at webpack_require (.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(ssr)/./src/app/page.tsx:11:86)
at (ssr)/./src/app/page.tsx (.next/server/app/page.js:138:1)
at Object.webpack_require [as require] (.next/server/webpack-runtime.js:33:43)
at JSON.parse () {
digest: '3392470

The dependency informaiton in package.json when I faced the problem.
"dependencies": {
"@adobe/react-spectrum": "^3.42.2",
"@adobe/react-spectrum-charts": "^1.18.1",
"canvas": "^3.1.1",
"next": "15.3.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vega": "^6.1.2",
"vega-lite": "^6.1.0"
},

🤔 Expected Behavior?

react-spectrum-charts support Next.js 15 and React 19.

😯 Current Behavior

✓ Compiled / in 5.6s (11054 modules)
⨯ TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
at (ssr)/./node_modules/@adobe/react-spectrum-charts/dist/index.js (.next/server/vendor-chunks/@adobe.js:19:1)
at webpack_require (.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(ssr)/./src/app/page.tsx:11:86)
at (ssr)/./src/app/page.tsx (.next/server/app/page.js:138:1)
at Object.webpack_require [as require] (.next/server/webpack-runtime.js:33:43)
at JSON.parse () {
digest: '3392470

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

The dependency informaiton in package.json when I faced the problem.
"dependencies": {
"@adobe/react-spectrum": "^3.42.2",
"@adobe/react-spectrum-charts": "^1.18.1",
"canvas": "^3.1.1",
"next": "15.3.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vega": "^6.1.2",
"vega-lite": "^6.1.0"
},

Version

1.18.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

MacOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions