N
Nuxt2mo ago
Phillip

"Cannot find module or its corresponding type declarations.ts(2307)"

Hey there, I'm having trouble importing my types and constants with the @ directive. It used to work like this:
import { ICampaign, ICampaignApiData, IFacebookUpdateResponse, TCampaignStatus } from '@/types/facebook';
import { CREATE_NEW_CAMPAIGN, CAMPAIGN_EDIT_DETAIL, CAMPAIGNS_OVERVIEW_CHOOSE_TYPE } from '@/constants/routes'
import { ICampaign, ICampaignApiData, IFacebookUpdateResponse, TCampaignStatus } from '@/types/facebook';
import { CREATE_NEW_CAMPAIGN, CAMPAIGN_EDIT_DETAIL, CAMPAIGNS_OVERVIEW_CHOOSE_TYPE } from '@/constants/routes'
But now I'm getting "Cannot find module '@/constants/routes' or its corresponding type declarations.ts(2307)" When I try to access the files without @ it works. Why is that?
1 Reply
Phillip
Phillip2mo ago
Solved it. I accidentally had this line in my tsconfig
"compilerOptions": {
"baseUrl": ".",
...
"compilerOptions": {
"baseUrl": ".",
...
Want results from more Discord servers?
Add your server