Search code examples
spartacus-storefront

SAP Spartacus Unhandled Promise rejection: R3InjectorError(AppModule)[ApplicationModule


Hi I'm having an issue with using Spartacus 4.3 in zone.js. Build is successful but I cannot view my local since it has an issue with Unhandled Promise rejection: R3InjectorError(AppModule)[ApplicationModule. Please advise

Heres what's inside my package.json

"dependencies": {
    "@angular/animations": "~12.2.16",
    "@angular/common": "~12.2.16",
    "@angular/compiler": "~12.2.16",
    "@angular/core": "~12.2.16",
    "@angular/forms": "~12.2.16",
    "@angular/platform-browser": "~12.2.16",
    "@angular/platform-browser-dynamic": "~12.2.16",
    "@angular/router": "~12.2.16",
    "@angular/service-worker": "^12.0.5",
    "@ng-bootstrap/ng-bootstrap": "^10.0.0",
    "@ng-select/ng-select": "^7.0.1",
    "@ngrx/effects": "^12.1.0",
    "@ngrx/router-store": "^12.1.0",
    "@ngrx/store": "^12.1.0",
    "@spartacus/asm": "~4.3.8",
    "@spartacus/assets": "~4.3.8",
    "@spartacus/cart": "~4.3.8",
    "@spartacus/checkout": "~4.3.8",
    "@spartacus/core": "~4.3.8",
    "@spartacus/order": "~4.3.8",
    "@spartacus/product": "~4.3.8",
    "@spartacus/smartedit": "~4.3.8",
    "@spartacus/storefinder": "~4.3.8",
    "@spartacus/storefront": "~4.3.8",
    "@spartacus/styles": "~4.3.8",
    "@spartacus/tracking": "~4.3.8",
    "@spartacus/user": "~4.3.8",
    "angular-oauth2-oidc": "^10.0.1",
    "bootstrap": "^4.3.1",
    "i18next": "^20.2.2",
    "i18next-http-backend": "^1.2.2",
    "ngx-infinite-scroll": "^8.0.0",
    "rxjs": "~6.5.4",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4",
    "@angular/platform-server": "~10.1.0",
    "@ngrx/store-devtools": "^8.6.0",
    "@nguniversal/express-engine": "^10.1.0",
    "@spartacus/setup": "^3.0.0-rc.2",
    "express": "^4.15.2",
    "ts-loader": "^6.0.4",
    "@types/express": "^4.17.0",
    "@angular/material-moment-adapter": "^9.1.2",
    "@ng-dynamic-forms/core": "^14.0.1",
    "@ng-dynamic-forms/ui-material": "^14.0.1",
    "angular2-text-mask": "^9.0.0",
    "country-flag-icons": "^1.1.1",
    "fastify": "^2.12.0",
    "jquery": "^3.4.1",
    "lodash-es": "^4.17.15",
    "material-dynamic-table": "^9.4.0",
    "moment-jdateformatparser": "^1.2.1",
    "ng-connection-service": "^1.0.4",
    "ng-recaptcha": "^5.0.0",
    "ng2-sticky-kit": "^6.1.0",
    "ngx-cookie": "^4.1.2",
    "ngx-cookie-service": "^3.0.3",
    "ngx-device-detector": "1.4.6",
    "ngx-image-zoom": "^1.0.1",
    "ngx-moment": "^5.0.0",
    "ngx-slick-carousel": "^0.4.7",
    "popper.js": "^1.16.0",
    "slick-carousel": "^1.8.1",
    "ngx-mask": "^13.1.13",
    "@angular/localize": "^12.0.5"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.2.18",
    "@angular-devkit/schematics": "^12.0.5",
    "@angular/cli": "~12.2.18",
    "@angular/compiler-cli": "~12.2.16",
    "@spartacus/schematics": "4",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "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.3.5",
    "@angular/material": "^12.2.13",
    "@angular/cdk": "^12.2.13",
    "angular2-template-loader": "0.6.2",
    "babel-loader": "^8.0.6",
    "element-closest-polyfill": "1.0.0",
    "file-saver": "^2.0.2",
    "hammerjs": "^2.0.8",
    "husky": "^4.3.0",
    "moment": "^2.24.0",
    "prettier": "^2.2.0",
    "prettier-plugin-organize-imports": "^1.1.1",
    "pretty-quick": "^3.1.0",
    "ts-loader": "^6.0.4",
    "webpack-cli": "^3.3.2",
    "@nguniversal/builders": "^10.1.0"
  },

is this related to this? https://github.com/SAP/spartacus/issues/11016

enter image description here


Solution

  • Hi was able to fixed the issue due to router module. Some modules requred in router module was not present.