ng-toolkit
ng-toolkit copied to clipboard
Getting error while installing ng add @ng-toolkit/universal
I'm submitting a...
[ ] C:\ORGOSIAS\orgosias>ng add @ng-toolkit/universal
Installing packages for tooling via npm.
ERROR: Invalid rule result: Function().
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.
Nothing to be done.
[ ] Feature request
[ ] Documentation issue or request
In package
[ ] @ng-toolkit/init
[ ] @ng-toolkit/serverless
[ ] @ng-toolkit/universal
[ ] @ng-toolkit/pwa
[ ] @ng-toolkit/firebug
Current behavior
Expected behavior
Minimal reproduction of the problem with instructions
Example repository
What is the motivation / use case for changing the behavior?
Environment
Angular version: X.Y.Z
- Node version: XX
- Platform:
Others:
Hello @krei-school,
Please use ng add @ng-toolkit/[email protected]
instead, for some reason, the package version being installed is a old version.
Cheers!
Hi @KingDarBoja , Thank you, but still getting same error even i tried with below
(current: {"os":"win32","arch":"x64"})
- @ng-toolkit/[email protected] updated 1 package in 29.564s Installed packages for tooling via npm. ERROR: Invalid rule result: Function(). 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. Nothing to be done.
Could you please provide any solution for that
Thanks, Vijay.
@krei-school I have no idea which rule would be causing this behaviour. Can you provide more info like your package.json
file, Angular version and so on?
I am waiting for my PR to be reviewed in order to fix those issues and ensure every package is working fine.
HI, I'm getting the same error.
Here's my package.json:
{ "name": "mean", "version": "2.0.2", "license": "MIT", "scripts": { "ng": "ng", "serve": "node server", "start": "$(npm bin)/concurrently -c "yellow.bold,green.bold" -n "SERVER,BUILD" "nodemon server" "ng build --watch"", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^6.0.3", "@angular/cdk": "^6.0.0", "@angular/common": "^6.0.3", "@angular/compiler": "^6.0.3", "@angular/core": "^6.0.3", "@angular/flex-layout": "^6.0.0-beta.16", "@angular/forms": "^6.0.3", "@angular/http": "^6.0.3", "@angular/material": "^6.0.0", "@angular/platform-browser": "^6.0.3", "@angular/platform-browser-dynamic": "^6.0.3", "@angular/router": "^6.0.3", "@hapi/joi": "^16.1.7", "@ng-toolkit/universal": "7.1.2", "@nguniversal/express-engine": "^6.0.7", "@ngx-loading-bar/core": "^4.1.1", "@ngx-loading-bar/http-client": "^4.1.1", "@ngx-loading-bar/router": "^4.1.1", "@schematics/angular": "^8.3.8", "@sweetalert2/ngx-sweetalert2": "^5.0.1", "angular-pipes": "^8.0.0", "angular-tree-component": "^7.2.0", "angulartics2": "7.5.2", "async": "^2.6.2", "aws-config": "^1.3.2", "aws-sdk": "^2.441.0", "bcrypt": "^3.0.2", "body-parser": "^1.18.2", "compression": "^1.7.2", "cookie-parser": "^1.4.3", "core-js": "2.5.7", "cors": "^2.8.4", "crypto": "^1.0.1", "dotenv": "^6.0.0", "events": "^3.0.0", "express": "^4.16.3", "express-async-handler": "^1.1.3", "express-jwt": "^5.3.1", "express-progressbar": "^2.0.0", "express-session": "^1.15.6", "express-validation": "^1.0.2", "formidable": "^1.2.1", "hammerjs": "^2.0.8", "helmet": "^3.12.0", "http-errors": "^1.6.3", "jquery": "^3.4.1", "jsonwebtoken": "^8.2.1", "lodash": "^4.17.11", "method-override": "^2.3.10", "mongoose": "^5.5.10", "mongoose-deep-populate": "^3.1.1", "mongoose-paginate-v2": "^1.3.0", "morgan": "^1.9.1", "multer": "^1.4.1", "ng2-dragula": "^1.5.0", "ng2-file-upload": "^1.3.0", "ngx-pagination": "^4.1.0", "ngx-quill": "^4.6.9", "ngx-slick-carousel": "^0.4.6", "ngx-toastr": "^9.1.2", "nodemailer": "^6.1.1", "nodemon": "^1.17.5", "passport": "^0.4.0", "passport-jwt": "^4.0.0", "passport-local": "^1.0.0", "quill": "^1.3.6", "quill-image-drop-module": "^1.0.3", "quill-image-resize-module": "^3.0.0", "quill-tweet": "^1.0.0", "rxjs": "6.2.0", "rxjs-compat": "^6.0.0-rc.0", "s3": "^4.4.0", "sharp": "^0.21.3", "slick-carousel": "^1.8.1", "slugify": "^1.3.4", "swagger-ui-express": "^3.0.9", "sweetalert2": "^8.8.7", "uuid": "^3.3.2", "webpack": "^4.26.1", "webpack-cli": "^3.3.9", "webpack-dev-server": "^3.1.10", "youtube-node": "^1.3.3", "zone.js": "0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.7.0-beta.1", "@angular/cli": "^6.0.7", "@angular/compiler-cli": "6.0.3", "@angular/language-service": "6.0.3", "@fortawesome/fontawesome-free": "^5.10.2", "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~10.3.0", "codelyzer": "4.3.0", "concurrently": "^3.5.1", "eslint": "^5.12.0", "eslint-config-angular": "^0.5.0", "eslint-config-google": "^0.11.0", "eslint-config-node": "^4.0.0", "eslint-plugin-angular": "^4.0.0", "eslint-plugin-requirejs": "^3.2.0", "jasmine-core": "~3.1.0", "jasmine-spec-reporter": "~4.2.1", "jsdoc": "^3.5.5", "karma": "^3.1.3", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "2.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "1.1.0", "protractor": "^5.4.1", "reload": "^2.4.0", "ts-node": "~6.1.0", "tslint": "~5.10.0", "typescript": ">=2.7.0 <2.8.0" } }
And this is the trace when I'm trying to install it:
ubuntu@ip-172-31-11-97:~/folder$ ng add @ng-toolkit/[email protected] Installing packages for tooling via yarn. yarn add v1.19.0 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > @nguniversal/[email protected]" has unmet peer dependency "@angular/platform-server@^6.0.0". warning " > @ngx-loading-bar/[email protected]" has incorrect peer dependency "@angular/common@>=7.0.0". warning " > @ngx-loading-bar/[email protected]" has incorrect peer dependency "rxjs@>=6.3.0". warning " > @ngx-loading-bar/[email protected]" has incorrect peer dependency "@angular/router@>=7.0.0". warning " > [email protected]" has unmet peer dependency "joi@*". warning " > [email protected]" has incorrect peer dependency "@angular/core@^7.0.0 || ^8.0.0 || ^9.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/common@^7.0.0 || ^8.0.0 || ^9.0.0". warning " > [email protected]" has incorrect peer dependency "@angular/forms@^7.0.0 || ^8.0.0 || ^9.0.0". warning " > [email protected]" has incorrect peer dependency "zone.js@^0.9.1". warning " > @angular/[email protected]" has incorrect peer dependency "@angular/[email protected]". warning " > [email protected]" has unmet peer dependency "jasmine@>=3". warning " > @ng-toolkit/[email protected]" has incorrect peer dependency "@angular/common@^7.1.0". warning " > @ng-toolkit/[email protected]" has incorrect peer dependency "@angular/core@^7.1.0". warning "@ng-toolkit/universal > @nguniversal/[email protected]" has incorrect peer dependency "@angular/common@^7.1.4". warning "@ng-toolkit/universal > @nguniversal/[email protected]" has incorrect peer dependency "@angular/core@^7.1.4". warning "@ng-toolkit/universal > @nguniversal/[email protected]" has unmet peer dependency "@angular/platform-server@^7.1.4". [4/4] Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ @ng-toolkit/[email protected] info All dependencies └─ @ng-toolkit/[email protected] Done in 13.10s. Installed packages for tooling via yarn. ERROR: Invalid rule result: Function(). 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. Nothing to be done.
@rubenjimenez Can you upgrade the project to Angular 7 then Angular 8 and test it again?
I do feel like it is being related to Angular version mismatch.
Hi @KingDarBoja,
I upgraded the project to Angular 8 and apparently it's working like a charm.
I tried @ng-toolkit/universal installation again and I got a different error:
iMac-de-Ruben:folder ruben$ ng add @ng-toolkit/universal [--http false] Installing packages for tooling via yarn. yarn add v1.17.3 [1/4] 🔍 Resolving packages... warning @ng-toolkit/universal > @ng-toolkit/_utils > [email protected]: All projects should upgrade to our universal JS notifier: "@bugsnag/js". See https://github.com/bugsnag/bugsnag-js/blob/master/UPGRADING.md for more details. warning @ng-toolkit/universal > @ng-toolkit/_utils > bugsnag > cuid > [email protected]: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... [4/4] 🔨 Building fresh packages... success Saved lockfile. success Saved 7 new dependencies. info Direct dependencies └─ @ng-toolkit/[email protected] info All dependencies ├─ @ng-toolkit/[email protected] ├─ @ng-toolkit/[email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] ├─ [email protected] └─ [email protected] ✨ Done in 18.81s. Installed packages for tooling via yarn. Two or more projects are using identical roots. Unable to determine project using current working directory. Using default workspace project instead. Two or more projects are using identical roots. Unable to determine project using current working directory. Using default workspace project instead. INFO: Project property is set to 'angular-material'. ERROR: Cannot read property 'unshift' 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. Nothing to be done.
I attach my package.json again (updated to Angular 8):
{ "name": "mean", "version": "2.0.2", "license": "MIT", "scripts": { "ng": "ng", "serve": "node server", "start": "$(npm bin)/concurrently -c "yellow.bold,green.bold" -n "SERVER,BUILD" "nodemon server" "ng build --watch"", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "8.2.10", "@angular/cdk": "7.1.1", "@angular/common": "8.2.10", "@angular/compiler": "8.2.10", "@angular/core": "8.2.10", "@angular/flex-layout": "^7.0.0-beta.24", "@angular/forms": "8.2.10", "@angular/material": "7.1", "@angular/platform-browser": "8.2.10", "@angular/platform-browser-dynamic": "8.2.10", "@angular/platform-server": "8.2.10", "@angular/router": "8.2.10", "@hapi/joi": "^16.1.7", "@ng-toolkit/universal": "1.1.21", "@ngx-loading-bar/core": "^4.1.1", "@ngx-loading-bar/http-client": "^4.1.1", "@ngx-loading-bar/router": "^4.1.1", "@sweetalert2/ngx-sweetalert2": "6.0.1", "angular-pipes": "^8.0.0", "angular-tree-component": "^8.4.0", "angulartics2": "7.5.2", "async": "^2.6.2", "aws-config": "^1.3.2", "aws-sdk": "^2.441.0", "bcrypt": "^3.0.2", "body-parser": "^1.18.2", "compression": "^1.7.2", "cookie-parser": "^1.4.3", "core-js": "^2.4.1", "cors": "^2.8.4", "crypto": "^1.0.1", "dotenv": "^6.0.0", "events": "^3.0.0", "express": "^4.16.3", "express-async-handler": "^1.1.3", "express-jwt": "^5.3.1", "express-progressbar": "^2.0.0", "express-session": "^1.15.6", "formidable": "^1.2.1", "hammerjs": "^2.0.8", "helmet": "^3.12.0", "http-errors": "^1.6.3", "jasmine": "3", "jquery": "^3.4.1", "jsonwebtoken": "^8.2.1", "lodash": "^4.17.11", "method-override": "^2.3.10", "mongoose": "^5.5.10", "mongoose-deep-populate": "^3.1.1", "mongoose-paginate-v2": "^1.3.0", "morgan": "^1.9.1", "multer": "^1.4.1", "ng2-dragula": "^1.5.0", "ng2-file-upload": "^1.3.0", "ngx-pagination": "^4.1.0", "ngx-quill": "7.3.2", "ngx-slick-carousel": "0.4.5", "ngx-toastr": "11.1.0", "nodemailer": "^6.1.1", "nodemon": "^1.17.5", "passport": "^0.4.0", "passport-jwt": "^4.0.0", "passport-local": "^1.0.0", "quill": "^1.3.6", "quill-image-drop-module": "^1.0.3", "quill-image-resize-module": "^3.0.0", "quill-tweet": "^1.0.0", "rxjs": "6.5.3", "s3": "^4.4.0", "sharp": "^0.21.3", "slick-carousel": "^1.8.1", "slugify": "^1.3.4", "swagger-ui-express": "^3.0.9", "sweetalert2": "^8.17.1", "uuid": "^3.3.2", "webpack": "~4.9.2", "webpack-cli": "^3.3.9", "webpack-dev-server": "^3.1.10", "youtube-node": "^1.3.3", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "^0.803.8", "@angular/cli": "8.3.8", "@angular/compiler-cli": "8.2.10", "@angular/language-service": "8.2.10", "@fortawesome/fontawesome-free": "^5.10.2", "@types/jasmine": "3", "@types/jasminewd2": "~2.0.2", "@types/node": "~10.3.0", "codelyzer": "^5.1.2", "concurrently": "^3.5.1", "eslint": "^5.12.0", "eslint-config-angular": "^0.5.0", "eslint-config-google": "^0.11.0", "eslint-config-node": "^4.0.0", "eslint-plugin-angular": "^4.0.0", "eslint-plugin-requirejs": "^3.2.0", "jasmine-core": "~3.1.0", "jasmine-spec-reporter": "~4.2.1", "jsdoc": "^3.5.5", "karma": "^3.1.3", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "2.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "1.1.0", "protractor": "^5.4.1", "reload": "^2.4.0", "ts-node": "~6.1.0", "tslint": "~5.10.0", "typescript": "3.5.3" } }
Any idea?
Thanks!
@KingDarBoja, forget my previous post. I solved all the errors by selecting the proper version of universal:
ng add @ng-toolkit/[email protected]
Without indicating the version it install 1.2.1, which seems to be broken. At least, with Angular 8.
The main problem now is that it doesn't work. According to the video tutorial, after installing, running ng build --prod and node server it should work but it doesn't.
I try to do curl localhost:4040 and I don't get the prerendered page. It's worthy to mention that the installation didn't change any file in my project. Neither update nor create. I guess this is not the expected behavior.
Any idea?
Thanks!
@rubenjimenez Sorry for the late response, been busy with job and other stuff.
And yeah, I think the current version is a bit bugged, hopefully the next version will fix several issues (as I made the PR for it) and properly install the latest version.
Of course, we do have to wait for the author to release it at npm first.
Cheers!
@rubenjimenez Please try again, latest version has been released and it should be fixed now 💯
I can not get ng-toolkit/universal 8.1.0 to work with Angular CL 11.0.3. is it only compatible with version 8.1 and lower?