Closed helloabhinab closed 3 years ago
I'm trying to do server side rendering in Angular. But while I run command npm run serve:ssr shows error typeerror i0.ɵɵdefineinjectable is not a function. Also shows Below is my package.json
npm run serve:ssr
ypeerror i0.ɵɵdefineinjectable is not a function. Also shows
package.json
`{ "name": "activitynew", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "compile:server": "webpack --config webpack.server.config.js --progress --colors", "serve:ssr": "node dist/server", "build:ssr": "npm run build:client-and-server-bundles && npm run compile:server", "build:client-and-server-bundles": "ng build --prod && ng run activitynew:server:production" }, "private": true, "dependencies": { "@angular/animations": "~7.2.0", "@angular/cdk": "8.1.1", "@angular/common": "~7.2.0", "@angular/compiler": "~7.2.0", "@angular/core": "~7.2.0", "@angular/forms": "~7.2.0", "@angular/http": "~7.2.0", "@angular/platform-browser": "~7.2.0", "@angular/platform-browser-dynamic": "~7.2.0", "@angular/platform-server": "~7.2.0", "@angular/router": "~7.2.0", "@fortawesome/fontawesome-free": "5.8.1", "@fullcalendar/core": "4.3.1", "@ng-bootstrap/ng-bootstrap": "4.2.1", "@ngrx/effects": "8.1.0", "@ngrx/entity": "8.1.0", "@ngrx/router-store": "8.1.0", "@ngrx/store": "8.1.0", "@ngrx/store-devtools": "8.1.0", "@nguniversal/express-engine": "^7.1.1", "@nguniversal/module-map-ngfactory-loader": "0.0.0", "@ngx-gallery/core": "^5.0.0-beta.0", "@ngx-loading-bar/core": "4.2.0", "@ngx-translate/core": "^11.0.1", "@schematics/angular": "^11.1.2", "@types/lodash": "4.14.136", "angular-in-memory-web-api": "^0.11.0", "angular-moment": "^1.3.0", "angularx-qrcode": "^11.0.0", "bootstrap": "4.3.1", "chart.js": "2.9.3", "chartist": "0.11.3", "classlist.js": "1.1.20150312", "core-js": "^2.5.4", "crypto-js": "^4.0.0", "express": "^4.15.2", "hammerjs": "2.0.8", "highlight.js": "9.15.8", "jquery": "3.4.1", "lodash": "^4.17.15", "lodash.range": "^3.2.0", "material-design-icons": "3.0.1", "mdbootstrap": "^4.15.0", "moment": "2.24.0", "ng-click-outside": "^6.0.0", "ng-inline-svg": "^11.0.2", "ng-wizard": "^1.0.0", "ng2-search-filter": "0.5.1", "ngrx-store-freeze": "0.2.4", "ngx-bootstrap": "^6.1.0", "ngx-clipboard": "12.2.0", "ngx-daterangepicker-material": "2.1.7", "ngx-device-detector": "^2.0.0", "ngx-dynamic-form-builder": "^1.2.0", "ngx-highlightjs": "3.0.3", "ngx-image-cropper": "^3.3.3", "ngx-lightbox": "^2.2.2", "ngx-owl-carousel": "2.0.7", "ngx-owl-carousel-o": "2.0.3", "ngx-perfect-scrollbar": "^10.1.0", "ngx-permissions": "^8.1.1", "ngx-youtube-player": "^7.1.1", "object-path": "0.11.4", "owl.carousel": "2.3.4", "perfect-scrollbar": "1.4.0", "popper.js": "1.15.0", "primeicons": "2.0.0", "primeng": "^7.1.3", "quill": "1.3.7", "rxjs": "~6.3.3", "rxjs-compat": "^6.5.4", "socicon": "3.0.5", "tooltip.js": "1.3.2", "ts-loader": "^8.0.14", "tslib": "^1.9.0", "web-animations-js": "2.3.2", "zone.js": "~0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.13.0", "@angular/cli": "~7.3.10", "@angular/compiler-cli": "~7.2.0", "@angular/language-service": "~7.2.0", "@types/node": "~8.9.4", "@types/jasmine": "~2.8.8", "@types/jasminewd2": "~2.0.3", "codelyzer": "~4.5.0", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.0.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.4.0", "ts-loader": "^5.2.0", "ts-node": "~7.0.0", "tslint": "~5.11.0", "typescript": "~3.2.2", "webpack-cli": "^3.1.0", "@types/highlight.js": "9.12.3", "@angular/material": "8.1.1", "@angular/material-moment-adapter": "8.1.1", "@ngrx/schematics": "8.1.0", "@types/chartist": "0.9.46", "@types/object-path": "0.11.0", "webpack-bundle-analyzer": "3.3.2" } } `
There's major version bumps of the library for Angular updates. You'd need to make sure you're using the correct version that works with Angular 7.
I'm trying to do server side rendering in Angular. But while I run command
npm run serve:ssr
shows error typeerror i0.ɵɵdefineinjectable is not a function. Also shows
Below is mypackage.json