However, when i try to import the file as import { Checklist } from ‘…/interfaces/checklists’;,
it gives me an error TS2306 saying ‘./checklists.ts’ is not a module
Try just running “ionic build” to eliminate any problems caused by stale file caching.
That’s weird, because the error you report comes from tsc, the TypeScript compiler, but by the time there are elements in a browser, tsc has already done its work and left the theatre.
I’m not asking about the contents of the file containing ChecklistItem, but rather the line that is importing it:
import { Checklist } from ‘…/interfaces/checklists’;
^--- these three dots, which may in fact be a single ellipsis
Ellipses don’t belong in paths; two dots mean “up a level”.
They seem to be at different directory depths, so one is going to have to have an extra set of ../ to get to the right place - they can’t have identical import lines. Your IDE should be dealing with all this, though.
I attached a screenshot with the error message to the left. Both files are up one folder - under app in src folder. I tried to run ionic build to fix the error but it showed the same error.