Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Karan16-prog opened this issue Jan 25, 2024 · 3 comments
Open

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

Karan16-prog opened this issue Jan 25, 2024 · 3 comments

Comments

@Karan16-prog
Copy link

Karan16-prog commented Jan 25, 2024

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
Copy link
Owner

wa0x6e commented Jan 25, 2024

What's your package.json module ?

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

@Karan16-prog
Copy link
Author

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
Copy link
Owner

wa0x6e commented Jan 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants