maciejtreder / ng-toolkit

:star: Angular tool-box! Start your PWA in two steps! Add Serverless support for existing projects and much more
https://www.angular-universal-pwa.maciejtreder.com
MIT License
1.12k stars 156 forks source link

angular universal error #760

Open himanshu9407 opened 4 years ago

himanshu9407 commented 4 years ago

Hello Sir,

My name is Himanshu. I need Your help actually i run ng add @ng-toolkit/universal command then Skipping installation: Package already installed ERROR: Cannot read property 'kind' of undefined ERROR: If you think that this error shouldn't occur, please fill up bug report here: https://github.com/maciejtreder/ng-toolkit/issues/new INFO: stacktrace has been sent to tracking system.

this error is showing

please help how can i solve this error

i will show you my package.json and angular.json file data

{ "name": "visa-app", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build && gzipper --verbose ./dist", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "postbuild": "gulp compress", "gzipper": "gzipper" }, "private": true, "dependencies": { "@angular/animations": "8.2.11", "@angular/cdk": "^8.2.3", "@angular/common": "^8.2.14", "@angular/compiler": "^8.2.14", "@angular/core": "^8.2.14", "@angular/forms": "^8.2.14", "@angular/material": "^8.2.3", "@angular/platform-browser": "^8.2.14", "@angular/platform-browser-dynamic": "^8.2.14", "@angular/pwa": "^0.803.21", "@angular/router": "^8.2.14", "@angular/service-worker": "~8.1.0", "@ng-bootstrap/ng-bootstrap": "^5.1.4", "@ng-toolkit/universal": "^7.1.2", "angular-material-datepicker": "^1.0.2", "axios": "^0.19.0", "bootstrap": "^4.4.1", "core-js": "^3.6.4", "flatpickr": "^4.6.3", "gzipper": "^3.4.2", "hammerjs": "^2.0.8", "jquery": "^3.4.1", "ng2-flatpickr": "^8.0.5", "ngx-pagination": "^4.1.0", "ngx-webstorage-service": "^4.1.0", "node": "^12.14.0", "rxjs": "^6.5.4", "tslib": "^1.9.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "^0.803.21", "@angular/cli": "^8.3.21", "@angular/compiler-cli": "^8.2.14", "@angular/language-service": "^8.2.14", "@types/jasmine": "^3.5.0", "@types/jasminewd2": "^2.0.8", "@types/jquery": "^3.3.31", "@types/node": "^12.12.21", "codelyzer": "^5.2.1", "gulp": "^4.0.2", "gulp-gzip": "^1.4.2", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "^2.1.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.5.1", "protractor": "~5.4.0", "ts-node": "~8.3.0", "tslint": "~5.18.0", "typescript": "3.4.5" } }

angular.json

{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "visa-App": { "root": "", "sourceRoot": "src", "projectType": "application", "prefix": "app", "schematics": {}, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/visa-App", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", "assets": [ "src/favicon.png", "src/assets", "src/manifest.webmanifest" ], "styles": [ "src/styles.css" ], "scripts": [], "es5BrowserSupport": true }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "budgets": [ { "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" } ], "serviceWorker": false, "ngswConfigPath": "ngsw-config.json" } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "visa-App:build" }, "configurations": { "production": { "browserTarget": "visa-App:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "visa-App:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "src/karma.conf.js", "styles": [ "src/styles.css", "/node_modules/air-datepicker/dist/css/datepicker.min.css" ], "scripts": [ "/node_modules/air-datepicker/dist/js/datepicker.min.js", "" ], "assets": [ "src/favicon.ico", "src/assets", "src/manifest.webmanifest" ] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "src/tsconfig.app.json", "src/tsconfig.spec.json" ], "exclude": [ "/node_modules/" ] } } } }, "visa-App-e2e": { "root": "e2e/", "projectType": "application", "prefix": "", "architect": { "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", "devServerTarget": "visa-App:serve" }, "configurations": { "production": { "devServerTarget": "visa-App:serve:production" } } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": "e2e/tsconfig.e2e.json", "exclude": [ "/node_modules/" ] } } } } }, "defaultProject": "visa-App" }

KingDarBoja commented 4 years ago

Hello @himanshu9407

You should try to run ng add @ng-toolkit/universal@8.0.3 and if that doesn't work, please remove the package from package.json and try again.

I am aware that maybe the library doesn't work at all when moving between version as there isn't a migration schematic for that.

pashyaaa commented 4 years ago

I got a similar issue I tried removing the package and installing a new one but it is not working for me.