In Nextjs application while I'm run the command for build and export there was an ReferenceError
I've attached the screenshot for your reference..
When remove the import of chartjs-plugin-zoom from the project, the build and export works properly..
This is because nextjs by default use server-side rendering. And zoom-plugin requires
window
object, but it is not available since the component is rendered on a node.To make work component which relies on browser API ,
next/dynamic
import can be usedchart-with-zoom.jsx
app.jsx