Add Official Support for Next.js (Next.js-Compatible Build & Documentation) #5131
Replies: 1 comment
-
|
Hi team, I would like to request official support for using ApexCharts with Next.js. Currently, ApexCharts does not provide a Next.js-compatible build, and developers need to rely on workarounds like dynamic imports (ssr: false) to avoid errors such as window is not defined. Why this is needed Next.js is widely adopted, and proper support would make ApexCharts easier to use without hacks. Many users face issues with SSR, hydration, and client/server boundaries when trying to integrate the library. What would help A Next.js-ready build that avoids window/document usage during SSR A client-safe React wrapper that works with the App Router Clear documentation / examples for integrating ApexCharts in: Client Components App Router Pages Router Expected Outcome Developers should be able to import and use ApexCharts in Next.js without needing dynamic imports or custom SSR patches. Thanks for considering this request. It would greatly improve the developer experience and adoption of ApexCharts in modern React/Next.js projects. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello team,
When integrating ApexCharts with Next.js, the library throws errors during SSR because it expects a browser environment. To make it work, developers must disable SSR using next/dynamic, which is not ideal.
Expected behavior:
ApexCharts should offer a Next.js-friendly version or wrapper that prevents SSR issues.
Actual behavior:
Errors such as:
ReferenceError: window is not defined
document is not defined
Requested solution:
Create an SSR-safe build for Next.js
Publish an example or official guide
Provide a React component compatible with both Client & Server environments
Would appreciate improved support for Next.js users. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions