I created a file in my route called jsconfig.json:
{
"compilerOptions": {
"baseUrl": "."
}
}
I have the latest nextjs "next": "latest"
Currently to import components, i have to do something like this:
import AppHeader from "../../../../components/common/AppHeader";
However with those changes above i thought I could do this:
import AppHeader from "src/components/common/AppHeader";
But I get this message:
Module not found: Can't resolve 'src/components/common/AppHeader'
Directory structure:
/
-->lib
-->src
-->components
-->public
Any ideas?
I also tried adding this to my next.config.js file but also doesnt make a difference:
config.resolve.modules.push(__dirname)