bartholomej / ngx-scrolltop

Lightweight, Material Design inspired "go to top button". No dependencies. Pure Angular!
http://bartholomej.github.io/ngx-scrolltop/
MIT License
30 stars 3 forks source link

No works with Angular 14 lastest #66

Closed AlonsoK28 closed 1 year ago

AlonsoK28 commented 1 year ago

I cant use your library after update to lastest@angular14

Your global Angular CLI version (15.0.4) is greater than your local version (14.2.10). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

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

Angular CLI: 14.2.10
Node: 16.17.0
Package Manager: npm 8.15.0 
OS: darwin arm64

Angular: 14.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.10
@angular-devkit/build-angular   14.2.10
@angular-devkit/core            14.2.10
@angular-devkit/schematics      14.2.10
@angular/cli                    14.2.10
@schematics/angular             14.2.10
rxjs                            6.6.7
typescript                      4.8.4

I am getting the following error when try to run ng serve


Error: node_modules/ngx-scrolltop/lib/ngx-scrolltop.component.d.ts:21:18 - error TS2707: Generic type 'ɵɵComponentDeclaration' requires between 7 and 8 type arguments.

21     static ɵcmp: i0.ɵɵComponentDeclaration<NgxScrollTopComponent, "ngx-scrolltop", never, { "backgroundColor": "backgroundColor"; "symbolColor": "symbolColor"; "size": "size"; "symbol": "symbol"; "position": "position"; "theme": "theme"; "mode": "mode"; }, {}, never, ["*"], false, never>;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/ngx-scrolltop/lib/ngx-scrolltop.directive.d.ts:17:18 - error TS2707: Generic type 'ɵɵDirectiveDeclaration' requires between 6 and 8 type arguments.

17     static ɵdir: i0.ɵɵDirectiveDeclaration<NgxScrollTopDirective, "[ngxScrollTop]", never, { "mode": "ngxScrollTopMode"; }, {}, never, never, false, never>;

I think the version of the library is correct but no works

% npm list ngx-scrolltop
my-app@2.2.1
└── ngx-scrolltop@5.0.2

my package.json

{
  "name": "myapp",
  "version": "2.2.1",
  "scripts": {
    "ng": "ng",
    "start": "ng s -o",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ng build",
    "bundle-analizer": "ng build --stats-json && npx webpack-bundle-analyzer dist/myapp/stats.json",
    "bundle-dist-app": "ng build && node bundle-dist-config.js && start .",
    "sonar": "sonar-scanner",
    "test-code": "concurrently --raw \"ng test --watch --code-coverage\" \"node open-file-explorer\" ",
    "test-code-coverage": "ng test --watch --code-coverage",
    "bundle-dist-app-ci": "ng build && node bundle-dist-config.js",
    "test-code-ci": "npm run test -- --browsers ChromeHeadless --watch false --code-coverage false",
    "compodoc:build": "compodoc -p tsconfig.doc.json",
    "compodoc:build-and-serve": "compodoc -p tsconfig.doc.json -s",
    "compodoc:serve": "compodoc -s"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.2.12",
    "@angular/common": "^14.2.12",
    "@angular/compiler": "^14.2.12",
    "@angular/core": "^14.2.12",
    "@angular/forms": "^14.2.12",
    "@angular/platform-browser": "^14.2.12",
    "@angular/platform-browser-dynamic": "^14.2.12",
    "@angular/router": "^14.2.12",
    "@angular/service-worker": "^14.2.12",
    "animate.css": "^4.1.1",
    "bootstrap": "^5.2.3",
    "bootswatch": "^5.1.3",
    "colors": "^1.4.0",
    "concurrently": "^7.2.2",
    "core-js": "^2.6.11",
    "date-fns": "^2.27.0",
    "express": "^4.17.1",
    "karma-coverage": "^2.2.0",
    "karma-mocha-reporter": "^2.2.5",
    "ng-lazyload-image": "^9.1.0",
    "ng-navigator-share": "^1.0.4",
    "ngx-masonry": "^13.0.0",
    "ngx-order-pipe": "^2.2.0",
    "ngx-pagination": "^5.0.0",
    "ngx-scrolltop": "^5.0.2",
    "ngx-stars": "^1.5.1",
    "ngx-toastr": "^12.1.0",
    "open": "^8.4.0",
    "rxjs": "^6.6.7",
    "tslib": "^1.11.1",
    "webpack-bundle-analyzer": "^4.5.0",
    "zip-lib": "^0.7.2",
    "zone.js": "^0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.2.10",
    "@angular/cli": "^14.2.10",
    "@angular/compiler-cli": "^14.2.12",
    "@angular/language-service": "^14.2.12",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^12.12.34",
    "jasmine-core": "^4.1.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^6.3.19",
    "karma-chrome-launcher": "^3.1.1",
    "karma-coverage-istanbul-reporter": "^2.1.1",
    "karma-jasmine": "^4.0.2",
    "karma-jasmine-html-reporter": "^1.7.0",
    "protractor": "^7.0.0",
    "sonar-scanner": "^3.1.0",
    "ts-node": "~7.0.0",
    "tslint": "~6.1.3",
    "typescript": "~4.8.4"
  }
}
tnohelty commented 1 year ago

I am seeing the exact same error and have a very similar package.json using version 14 of angular

bartholomej commented 1 year ago

You're right! Thank you for your feedback. Have you tried it with ngx-scrolltop version 4.x.x? There was a mistake in the compatibility table.

npm install ngx-scrolltop@4 --save
# ng add ngx-scrolltop@4

So in package.json you'll have this: "ngx-scrolltop": "^4.3.0"

Let me know and I'll fix the documentation ;)

tnohelty commented 1 year ago

This worked perfectly! Thanks

bartholomej commented 1 year ago

@tnohelty @AlonsoK28 Compatibility table updated Thanks guys