2

ERROR Error: Uncaught (in promise): Error: The NgModule 'ApprovalModule' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.

JIT compilation is discouraged for production use-cases! Consider using AOT mode instead. Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server', or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping. Error: The NgModule 'ApprovalModule' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.

JIT compilation is discouraged for production use-cases! Consider using AOT mode instead. Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server', or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.

When i Navigate one menu to another i am getting above error. "@angular-devkit/build-angular": "~13.0.1", "@angular/cli": "~13.0.1", "@angular/compiler-cli": "~13.0.1", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.8", "@types/node": "^12.11.1", "codelyzer": "^6.0.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.1.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.3", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "~4.4.3", "primeflex": "3.1.0", "primeicons": "5.0.0", "primeng": "13.0.2", "prismjs": "1.9.0", "rxjs": "~6.6.0"

Node:v16.13.1,Npm:8.1.2

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Feb 3, 2022 at 9:01

1 Answer 1

1

This error can pop up when ng serve is running and you add a new module. What worked for me is to simply restart ng serve.

You should also check these posts:
Uncaught (in promise): Error: Angular JIT compilation failed: '@angular/compiler' not loaded! in angular 9

https://www.reddit.com/r/angular/comments/1cmv53h/what_are_the_causes_and_best_options_to_resolve/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.