Failed to compile
Next.js (14.2.4) ./src/app/layout.js:3:1 Module not found: Can’t
resolve ‘@/src/components/layout/Header’
The problem occurred out of nowhere 2 days ago the code was working fine and yesterday it started giving me this error.
- Error: https://i.sstatic.net/XNSroLcg.png
- Files: https://i.sstatic.net/v89ycKio.png
- Header https://i.sstatic.net/wnBgUmY8.png
The last thing I did was I linked it to MongoDB, I tried deleting .next, node_modules, updating…
2
Answers
Yes, i have found out that import Header from "F:/nov/src/components/layout/Header.js"; works, but dont know how to configure jsconfig so that the previous paths will work None of the imports work.
Have you tried,
instead of:
do this:
Do the other imports work? Can they be resolved? Or is it only the Header component. Can you provide a more detailed description of the enviroment and maybe produce a minimal reproducer, which we can look into?