Loading...
Loading...
Module not found: Can't resolve '@/components/MyComponent'Next.js supports the @ path alias to refer to the project root. This error means either the file doesn't exist at the path you specified, the alias isn't configured, or there's a typo in the import path.
Add the paths configuration to enable the @ alias.
// tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}Verify the file exists and the casing matches exactly (Linux is case-sensitive).
# Check if file exists
ls src/components/MyComponent.tsx
# Common mistake: wrong case
# ❌ import { myComponent } from '@/components/mycomponent'
# ✅ import { MyComponent } from '@/components/MyComponent'