when importing something using src\app... angular cli gives error " Module not found: Error: Can't resolve 'src/app/shared/k/k-api.service' in 'C:...' ". error TS2307: Cannot find module 'src/app/shared/k/k-api.service'
import { KAPIService } from 'src/app/shared/k/k-api.service';
but when using relative path it works just fine
import { KAPIService } from '../../../../shared/k/k-api.service';
I managed to solve it by changing
"baseUrl": "./",
to "baseUrl": "./src"
, in tsconfig.json
then
import { KAPIService } from 'app/shared/k/k-api.service';
not sure if this is the best solution, but works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With