Closed vidforstner closed 1 year ago
This error keeps popping up, Error: No "exports" main defined in C:\Users\info\3D Objects\4-Soft\investors\node_modules\chart.js\package.json
Error: No "exports" main defined in C:\Users\info\3D Objects\4-Soft\investors\node_modules\chart.js\package.json
My code looks like this and it works without date fns:
import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, Filler, TimeScale, } from "chart.js"; ChartJS.register( CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, Filler, TimeScale ); import "chartjs-adapter-date-fns"; import { Line } from "react-chartjs-2";
if i remove the import the code works fine
Issue ended up being in package.json and tsconfig.json in package.json i removed "type": "module"
"type": "module"
and changed tsconfig.json to "target": "es6",
"target": "es6",
This error keeps popping up,
Error: No "exports" main defined in C:\Users\info\3D Objects\4-Soft\investors\node_modules\chart.js\package.json
My code looks like this and it works without date fns:
if i remove the import the code works fine