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

[@ng-toolkit/universal] ERROR: newTree.optimize is not a function #776

Open januwA opened 4 years ago

januwA commented 4 years ago

🐞 bug report

Error while installing @ ng-toolkit/universal package

ajanuw@DESKTOP-HBG750D /d/ajanuw/ng9
λ ng add @ng-toolkit/universal
Installing packages for tooling via npm.
Installed packages for tooling via npm.
ERROR: newTree.optimize is not a 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.
ajanuw@DESKTOP-HBG750D /d/ajanuw/ng9
λ ng v

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 9.0.3
Node: 12.13.1
OS: win32 x64

Angular: 9.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@angular/cli                      9.0.3
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2
vijayhardaha commented 4 years ago

Same error for me.

ajay-arya commented 4 years ago

Getting the same error does anyone know to slove this...

KingDarBoja commented 4 years ago

The package doesn't support Angular 9 hence the error.

Please read #788.

IamDeshRaj commented 4 years ago

Any update on this..? can anyone help.?

IamDeshRaj commented 4 years ago

@januwA @vijayhardaha @ajay-arya if you are still facing issue have a look here on this reply if it helps you out.

Robinl2018 commented 4 years ago

Hi, I have the same issue, i solved it with this version ng add @ng-toolkit/universal@8.0.3

Akshay6396 commented 4 years ago

Hey Guys,

If you are using angular 9 then, Kindly run npm i @schematics/angular@9.1.0 npm i @angular-devkit/schematics@9.1.0

then ng add @ng-toolkit/universal

jersoncarranza commented 4 years ago

somebody fix this error ?

Mottihh commented 4 years ago

does anybody fix this error?

souravray commented 4 years ago

I have recently updated my project to Angular 10. Now I wanted to add @ng-toolkit/universal to the project Which is giving me this error

Installing packages for tooling via npm.
Installed packages for tooling via npm.
ERROR: newTree.optimize is not a 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.

My package json looks like

"dependencies": {
    "@angular/animations": "~10.0.4",
    "@angular/cdk": "^9.2.0",
    "@angular/common": "~10.0.4",
    "@angular/compiler": "~10.0.4",
    "@angular/core": "~10.0.4",
    "@angular/forms": "~10.0.4",
    "@angular/platform-browser": "~10.0.4",
    "@angular/platform-browser-dynamic": "~10.0.4",
    "@angular/router": "~10.0.4",
    "rxjs": "~6.5.4",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1000.3",
    "@angular-devkit/schematics": "^10.0.3",
    "@angular/cli": "~10.0.3",
    "@angular/compiler-cli": "~10.0.4",
    "@angular/language-service": "~10.0.4",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.12.36",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.9.6"
  }
}
jobnte commented 4 years ago

Does anybody fix this issue?

geetika-kathuria commented 4 years ago

Team, any update on this issue?

akandekar commented 3 years ago

i have angular 11.2.4 in my system and i got following issue

ERROR: newTree.optimize is not a 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.

Does any one solve this issue?

VaidasDatenis commented 3 years ago

Same problem here: angular 11.2.13 ERROR: newTree.optimize is not a 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.

elharony commented 3 years ago

I had this problem in Angular 10.0.0 (Fresh App installation, nothing added but ng new default packages)

$ ng add @ng-toolkit/universal
Installing packages for tooling via npm.
Installed packages for tooling via npm.
ERROR: newTree.optimize is not a 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.

Well, I thought it's a problem with my version being old, so I upgraded the Angular CLI to latest version, and create new Angular app in latest version 12.2.0, and here's the error I got:

$ ng add @ng-toolkit/universal
ℹ Using package manager: npm
✔ Found compatible package version: @ng-toolkit/universal@1.1.21.
✔ Package information loaded.

The package @ng-toolkit/universal@1.1.21 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
"ng-toolkit universal" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
ERROR: newTree.optimize is not a 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.

Any suggestions to fix it?