-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
useResponsive giving error #2263
Comments
similar: #2254 hi @narasimhajupally, you can solve this by: // ❌ error
import { configResponsive, useResponsive } from "ahooks";
// ✅ work
import { configResponsive, useResponsive } from "ahooks/es";
// ✅ work
import { configResponsive, useResponsive } from "ahooks/es/useResponsive";
// ✅ work
import { configResponsive, useResponsive } from "ahooks/lib";
// or
// ✅ work
import { configResponsive, useResponsive } from "ahooks/lib/useResponsive"; so, why can't we import hook from ahooks in next.js, I will keep track of this problem. thx for your feedback. |
@liuyib seems to be working on this. shouldn't this issue be open? |
related:
refer: vercel/next.js#52307 (comment), this issue seems to be SWC' problem. |
Related: vercel/next.js#53051 Maybe need another special transform for |
Nice catch! I'll try to find out what happened and let you known. |
The root cause is that Thanks @meteorlxy for the helpful suggestion. |
Now is 2024 this problem still lingered and not solved yet. |
It's the problem for Next.js, we can do nothing. |
This issue has been solved in Next.js >=14.0.4: https://github.com/vercel/next.js/pull/59294/files |
not able to use useResponsive in next js
the error in the console
other hooks are running fine.
The text was updated successfully, but these errors were encountered: