Hello Vercel Community,
I’m completely stuck after restoring snapshot v467 via the v0.dev LLM. My Next.js project uses path aliases in tsconfig.json (e.g. @/lib/, @/hooks/), but I can’t get my authentication hook to resolve:
- Implementation:
- Hook lives in lib/auth-context.tsx and is exported as useAuth.
- I created hooks/use-auth.ts to re-export from @/lib/auth-context.
- What I’ve tried:
- Switching imports between @/lib/auth-context, ../lib/auth-context and @/hooks/use-auth.
- Adjusting paths in tsconfig.json / jsconfig.json to map @/* → ["./"], @/lib/ → ["lib/"], @/hooks/ → [“hooks/*”].
- Verifying file structure and casing on disk.
- Current error:
The file “@/lib/auth-context” cannot be found (imported in “/hooks/use-auth”).
No matter how I reconfigure aliases or imports, the build/runtime throws “file not found.” I’ve spent dozens of AI-generated prompt attempts with no success.
Request:
Could someone please share a working example of Next.js path-alias setup for redirecting @/hooks/use-auth to lib/auth-context.tsx? Any pointers on tsconfig/jsconfig, folder structure, or import syntax that definitively breaks this loop would be hugely appreciated.
Thank you!
— Alexander