You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root reason is the modularizeImports config of Next.js, so in ahooks side, we can do nothing.
I have open a PR to resolve it: vercel/next.js#54657, but this still is a temp solution, once ahooks exports a new variable that different with file name, then it will be cause this problem again.
The permanent solution is that Next.js remove ahooks from modularizeImports config, just like this PR: https://github.com/vercel/next.js/pull/58992/files, but I don't think Next.js would agree to that (maybe will), because it will hurt start performance.
Uncaught Error: Module not found: Can't resolve 'ahooks/es/clearCache'
Node Version:
v18.14.0
// page.tsx
import { clearCache, useRequest } from 'ahooks'
// package.json
"ahooks": "^3.7.8", "next": "latest", "react": "^18.2.0",
// next.config.js
transpilePackages: ['ahooks'],
The text was updated successfully, but these errors were encountered: