@indxx,
Importing ‘@canvasjs/react-stockcharts’ dynamically for client side rendering should resolve the issue happening with the build script as well. Please take a look at the code snippet below for the same.
import dynamic from "next/dynamic";
const CanvasJSStockChart = dynamic(() => import("@canvasjs/react-stockcharts").then((mod) => mod.default.CanvasJSStockChart ), { ssr: false });
Also, check out this updated sample project for complete working code.
—–
Manoj Mohan
Team CanvasJS