IKatsuba/ngx-ssr

Can't build project for @ngx-ssr/cache

Myerden opened this issue · 5 comments

Describe the bug
Hi, thank you for developing this library. When i try to build my project, this build task throws error:
ERROR in node_modules/@ngx-ssr/cache/lib/cache.interceptor.d.ts:10:5 - error TS2416: Property 'intercept' in type 'CacheInterceptor' is not assignable to the same property in base type 'HttpInterceptor'.

Type '(request: HttpRequest, next: HttpHandler) => Observable<HttpEvent>' is not assignable to type '(req: HttpRequest, next: HttpHandler) => Observable<HttpEvent>'

To Reproduce
Steps to reproduce the behavior:

  1. Import the NgxSsrCacheModule module in AppModule to cache all GET requests
  2. Enable HTML caching for express
  3. npm run build:ssr

Expected behavior
Building successfully

Screenshots
Error:
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: -
  • Version: -

Additional context
package.json:

{
  "name": "myproject",
  "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 myproject:server:production --bundleDependencies all"
  },
  "private": true,
  "dependencies": {
	"@angular/animations": "~8.2.3",
	"@angular/common": "~8.2.3",
	"@angular/compiler": "~8.2.3",
	"@angular/core": "~8.2.3",
	"@angular/forms": "~8.2.3",
	"@angular/platform-browser": "~8.2.3",
	"@angular/platform-browser-dynamic": "~8.2.3",
	"@angular/platform-server": "~8.2.3",
	"@angular/router": "~8.2.3",
	"@nguniversal/common": "^11.2.1",
	"@nguniversal/express-engine": "^8.2.6",
	"@nguniversal/module-map-ngfactory-loader": "v8.2.6",
	"@ngx-ssr/cache": "^1.1.1",
	"angular-calendar": "^0.28.22",
	"bootstrap": "^5.0.0-beta2",
	"express": "^4.15.2",
	"jquery": "^3.5.1",
	"moment": "^2.29.1",
	"ng2-search-filter": "^0.5.1",
	"ngx-bootstrap": "^5.5.0",
	"ngx-page-scroll": "^7.0.1",
	"ngx-page-scroll-core": "^7.0.1",
	"ngx-pagination": "^5.0.0",
	"ngx-swiper-wrapper": "^8.0.0",
	"rxjs": "~6.4.0",
	"swiper": "^6.4.15",
	"tslib": "^1.10.0",
	"zone.js": "~0.9.1"
  },
  "devDependencies": {
	"@angular-devkit/build-angular": "~0.803.1",
	"@angular/cli": "~8.3.1",
	"@angular/compiler-cli": "~8.2.3",
	"@angular/language-service": "~8.2.3",
	"@types/express": "^4.17.0",
	"@types/node": "~8.9.4",
	"@types/jasmine": "~3.3.8",
	"@types/jasminewd2": "~2.0.3",
	"codelyzer": "^5.0.0",
	"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.0.1",
	"karma-jasmine": "~2.0.1",
	"karma-jasmine-html-reporter": "^1.4.0",
	"protractor": "~5.4.0",
	"ts-loader": "^5.2.0",
	"ts-node": "~7.0.0",
	"tslint": "~5.15.0",
	"typescript": "~3.5.3",
	"webpack-cli": "^3.1.0"
  }
}

Hi @Myerden! Thank you for reporting! What npm version are you using?

Hi @Myerden! Thank you for reporting! What npm version are you using?

Hi @IKatsuba,
npm version: 6.12.1
Could the problem related with Angular version?

@Myerden Change rxjs version to ~6.6.3 in your package.json and it will build.

@Myerden, sorry for the long request! We have no support for Angular 8. But you can try to update the rxjs version

After build fail, I didn't implement cache in my project. Thank you for your interests.