wa0x6e / cal-heatmap

Cal-Heatmap is a javascript charting library to create a time-series calendar heatmap
http://cal-heatmap.com
MIT License
2.69k stars 290 forks source link

Could not find a declaration file for module 'cal-heatmap' #469

Open Karan16-prog opened 7 months ago

Karan16-prog commented 7 months ago

Throwing the following error when importing via import CalHeatmap from "cal-heatmap";

Running this in next js 14

Could not find a declaration file for module 'cal-heatmap'. 
'/Users/karansingh/projects/habit-tracker/node_modules/cal-heatmap/dist/cal-heatmap.esm.js' implicitly has an 'any' type.
  There are types at '/Users/karansingh/projects/habit-tracker/node_modules/cal-heatmap/src/index.d.ts', 
  but this result could not be resolved when respecting package.json "exports". 
  The 'cal-heatmap' library may need to update its package.json or typings

Version: "cal-heatmap": "^4.2.4",

wa0x6e commented 7 months ago

What's your package.json module ?

And do you have a tsconfig ? If yes, what's the moduleResolution ?

Karan16-prog commented 7 months ago

What's your package.json module ?

And do you have a tsconfig ? If yes, what's the moduleResolution ?

tsconfig : "moduleResolution": "bundler",

No module in package.json Here:

{ "name": "habit-tracker", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-slot": "^1.0.2", "cal-heatmap": "^4.2.4", "canvas-confetti": "^1.9.2", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "grommet-icons": "^4.12.0", "lucide-react": "^0.312.0", "next": "14.1.0", "next-auth": "^4.24.5", "next-themes": "^0.2.1", "react": "^18", "react-dom": "^18", "tailwind-merge": "^2.2.0", "tailwindcss-animate": "^1.0.7", "zustand": "^4.5.0" }, "devDependencies": { "@types/cal-heatmap": "^3.5.39", "@types/canvas-confetti": "^1.6.4", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", "eslint": "^8", "eslint-config-next": "14.1.0", "postcss": "^8", "prisma": "^5.8.1", "tailwindcss": "^3.3.0", "typescript": "^5" } }

wa0x6e commented 7 months ago

In tsconfig.js, change your moduleResolution to node or node16