wa0x6e/cal-heatmap

React project using cal-heatmap and TypeScript cannot be built

haocheng6 opened this issue · 2 comments

The example React project (https://github.com/wa0x6e/cal-heatmap-react-starter) cannot be built with npm run build.

Output:

./src/components/cal-heatmap.tsx:2:21
Type error: Cannot find module 'cal-heatmap/plugins/Tooltip' or its corresponding type declarations.

  1 | import CalHeatmap from 'cal-heatmap';
> 2 | import Tooltip from 'cal-heatmap/plugins/Tooltip';
    |                     ^
  3 | import 'cal-heatmap/cal-heatmap.css';
  4 | 
  5 | export default function Cal() {

It looks like the types of the cal-heatmap package are not exported correctly in the package.json "exports" field.

I meat the same problem. And I fix it with "paths": { "@labzh/cal-heatmap": ["./node_modules/@labzh/cal-heatmap/src/index.d.ts"] } in tsconfig.json

Closing, see #366