I have used the importPath in my host as below -
registerComponent(ReAreaChart, {
name: “AreaChartPlasmic”,
importPath: “./components/Reareachart”,
importName: “ReAreaChart”,
description: “A customizable area chart component using Recharts library.”,
displayName: “Area Chart”,
props: {
className: {
type: “class”,
displayName: “Styles”,
},
data: {
type: “object”,
description: “Array of objects with label and value keys”,
defaultValue: [
{ label: “Jan”, value: 1200 },
{ label: “Feb”, value: 980 },
{ label: “Mar”, value: 1100 },
{ label: “Apr”, value: 1300 },
],
},
},
});
This is the component defination-
import {
AreaChart,
Area,
XAxis,
YAxis,
CartesianGrid,
Tooltip,
Legend,
} from “recharts”;
export function ReAreaChart({
data,
className,
}: {
data: any;
className?: string;
}) {
return (
// More area chart code
);
}
After publish this is the cloned repo , as you can see , it builds fine , but during runtime, i.e when i try to access localhost:3000 via browser its throwing this runtime error.
My gitHub repo - https://github.com/bharath3719/fistGraphExport
Plasmic Studio project - Plasmic