Error with angular srr prerendering with ngx-paypal

274 Views Asked by At

Trying to implement prerender on my angular 9 project but I get this error

When I run prerender

Prerendering 9 route(s) to C:\Users\Khaled\Desktop\MechatronicsSmartSolutions\dist\MechatronicsSmartSolutions\browser
(node:11896) UnhandledPromiseRejectionWarning: Error: No NgModule metadata found for 'class{}'.

Following this solution I have to enable ivy

AngularUniversal prerendering error: UnhandledPromiseRejectionWarning: Error: No NgModule metadata found for 'class{}'

But in this case I get this error from ngx-paypal

""This likely means that the library (ngx-paypal) which declares NgxPayPalModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.""

Tried reinstalling NPM modules didn't make any difference

package.json

"dependencies": {
    "@angular/animations": "~9.0.5",
    "@angular/common": "~9.0.5",
    "@angular/compiler": "~9.0.5",
    "@angular/core": "~9.0.5",
    "@angular/fire": "^5.4.0",
    "@angular/forms": "~9.0.5",
    "@angular/platform-browser": "~9.0.5",
    "@angular/platform-browser-dynamic": "~9.0.5",
    "@angular/platform-server": "~9.0.5",
    "@angular/router": "~9.0.5",
    "@fortawesome/angular-fontawesome": "^0.6.1",
    "@fortawesome/fontawesome-svg-core": "^1.2.28",
    "@fortawesome/free-brands-svg-icons": "^5.13.0",
    "@fortawesome/free-regular-svg-icons": "^5.13.0",
    "@fortawesome/free-solid-svg-icons": "^5.13.0",
    "@nguniversal/express-engine": "^9.1.1",
    "@sendgrid/mail": "^7.2.6",
    "emailjs-com": "^2.6.3",
    "express": "^4.15.2",
    "firebase": "^7.6.0",
    "ngx-owl-carousel-o": "^3.1.1",
    "ngx-page-scroll": "^7.0.3",
    "ngx-page-scroll-core": "^7.0.3",
    "ngx-pagination": "^5.0.0",
    "ngx-paypal": "^6.2.0",
    "ngx-spinner": "^9.0.1",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.5",
    "@angular/cli": "~9.0.5",
    "@angular/compiler-cli": "~9.0.5",
    "@angular/language-service": "~9.0.5",
    "@nguniversal/builders": "^9.1.1",
    "@types/express": "^4.17.0",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~5.18.0",
    "typescript": "~3.7.5"
  }
0

There are 0 best solutions below