angularstackblitz

Can't find file on stackblitz Angular project


I generated service in my 'services' directory and import it. I'm getting this error:

Import error, can't find file:
./services/timer-service.service

app.component.ts

import { TimerService } from  './services/timer.service';

https://stackblitz.com/edit/angular-subject-queue


Solution

  • There is no service exist on path './services/timer-service.service'. You must have rename service file name to './services/timer.service'

    You need to remove old reference from app.module.

    Below line to be removed and providers list will be updated accordingly.

    import { TimerServiceService } from './services/timer-service.service';