0
votes

I created a model named project to the existing project but when i import the class to another typescript file it throws the below error (VS2019)

import { Project } from "src/models/project";

ts2307 cannot find module "src/models/project" or its corresponding type declarations

please help me to sort out this issue

2

2 Answers

0
votes

Use relative path instead of absolute path, so something like ../../models/project

0
votes

I guess you didn't configure src alias in the tsconfig.json, so change your tsconfig.json like below:

{
    "compilerOptions": {
        "baseUrl": "./",
        "src/*": [
                "./src/*"
        ],
    }
}