angularangular7nrwlnrwl-nx

NRWL NX importing lib error TS2307: Cannot find module '@eduboard/interfaces'


I've just created a new NX project for work and I've created a lib for out interfaces to have them on the backend and the front end.

I'm getting this error when I compile

apps/askeddi/src/app/pages/global-admin/global-admin.component.ts(5,38): error TS2307: Cannot find module '@eduboard/interfaces'.

From everything i have read is that i have done nothing wrong but its asking for a module and its just an index.ts file.

export * from './lib/user';
export * from './lib/global-admin-dashboard';

And this the global-admin-dashboard

interface Schools {
  total: number;
  active: number;
  usingAssessor: number;
}

interface TotalNActive {
  total: number;
  active: number;
}

export interface GlobalAdminDashboard {
  schools: Schools;
  schoolGroups: TotalNActive;
  users: TotalNActive;
}


Solution

  • I found out how to fix my problem.

    So inside the tsconfig.app.json file, I added this to the paths.

    "@eduboard/interfaces" : [
      "../../../libs/interfaces/src/index"
      ]
    

    I had to go back a fair few because I had it have a baseURL set to src/