[x] Regression
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Using CacheInterceptor at global level results in following error on any route
[Nest] 69 - 03/19/2019, 10:55 AM [ExceptionsHandler] Cannot read property 'applicationRef' of undefined +7359ms
TypeError: Cannot read property 'applicationRef' of undefined
at CacheInterceptor.trackBy (/app/node_modules/@nestjs/common/cache/interceptors/cache.interceptor.js:45:49)
at CacheInterceptor.intercept (/app/node_modules/@nestjs/common/cache/interceptors/cache.interceptor.js:27:26)
at /app/node_modules/@nestjs/core/interceptors/interceptors-consumer.js:21:36
at InterceptorsConsumer.intercept (/app/node_modules/@nestjs/core/interceptors/interceptors-consumer.js:23:24)
at /app/node_modules/@nestjs/core/router/router-execution-context.js:41:60
at /app/node_modules/@nestjs/core/router/router-proxy.js:8:23
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at next (/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
No errors
Using implementation of global cache interceptor as per docs
import * as redisStore from 'cache-manager-redis-store';
import { Module, CacheModule, CacheInterceptor } from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { ConfigModule } from '../../config/config.module';
import { ProductDetailModule } from '../product-detail/product-detail.module';
@Module({
imports: [
ConfigModule,
ProductDetailModule,
CacheModule.register({
store: redisStore,
host: 'localhost',
port: 6379,
ttl: 120,
max: 50,
}),
],
controllers: [AppController],
providers: [
AppService,
{
provide: APP_INTERCEPTOR,
useClass: CacheInterceptor,
},
],
})
export class AppModule {}
Nest version: 6.0.1
For Tooling issues:
- Node version: v11.9.0
- Platform: Mac
Others:
Any help? Thanks!
Any news on this issue? I'm also facing this same problem
Fixed in 6.0.2 :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Fixed in 6.0.2 :)