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 .gitignore file has lib/ listed under the "Distribution / packaging" section, which is causing the frontend/src/lib/utils.ts file to be ignored because lib/ is a parent directory.
To resolve this, you can either:
Remove lib/ from .gitignore:
If you don't need to ignore the lib/ directory for other purposes, you can remove or comment out the lib/ line from your .gitignore file.
Add an Exception for the Specific File:
You can add an exception in the .gitignore file to explicitly include frontend/src/lib/utils.ts.
Issue Description
The Frontend app is missing frontend/src/lib/utils.ts
The utils serves as import for button.tsx (import { cn } from "@/lib/utils")
Imported by ./src/app/page.tsx
My Solution:
Create the file frontend/src/lib/utils.ts with contents:
export function cn(...classes: string[]) {
return classes.filter(Boolean).join(' ');
}
Resolves the issue.
The original error is:
Failed to compile
./src/components/ui/button.tsx:5:0
Module not found: Can't resolve '@/lib/utils'
3 | import { cva, type VariantProps } from "class-variance-authority"
4 |
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./src/app/page.tsx
The text was updated successfully, but these errors were encountered: