after importing my service "exercise.service.ts" in my newly generated page, the following error keeps appearing (using Angular 13.1 and Ionic 5):
ERROR NullInjectorError: R3InjectorError(i)[X -> X -> X -> X]:
NullInjectorError: No provider for X!
at Gc.get (main.js:1:1574683)
at vg.get (main.js:1:1576039)
at vg.get (main.js:1:1576039)
at vg.get (main.js:1:1576039)
at Uy.get (main.js:1:1605222)
at vg.get (main.js:1:1576039)
at Uy.get (main.js:1:1605222)
at Object.get (main.js:1:1602003)
at G (main.js:1:1549174)
at F (main.js:1:1549975)
The service is imported in the app.module.ts providers array:
providers: [
StatusBar,
SplashScreen,
AngularFireAuthGuard,
..,
..,
ExerciseService,
..
..
And in the "tutorial.page.ts" component as follows:
import { ExerciseService } from '../../shared/exercise.service';
constructor(
public exerciseState: ExerciseService,
..,
..
)
The exercise.service.ts has implemented the Injectable decorator:
@Injectable({
providedIn: "root",
})
export class ExerciseService {
When I additionally import exerciseService in the module of the component (tutorial.module.ts), the following error appears:
ERROR Error: Uncaught (in promise): Error: JIT compiler unavailable
Error: JIT compiler unavailable
So what is the error and why does it only keep reporting "No provider for X"? Is there anybody that could help here?
Looking forward for your answers!