• 12-12-2022, 16:52:23
    #1
    Arkadaşlar node.js ile build işlemi yaparken şöyle bi hata alıyorum ;

    => ERROR [build 7/7] RUN npx nx build driver-api --prod 53.9s
    ------
    > [build 7/7] RUN npx nx build driver-api --prod:
    #12 5.267
    #12 5.268 > nx run driver-api:buildroduction
    #12 5.268
    #12 53.66 chunk (runtime: main) main.js (main) 348 KiB [entry][rendered]
    #12 53.66
    #12 53.66 ERROR in /app/libs/database/src/lib/redis-pub-sub.provider.ts
    #12 53.66 ./libs/database/src/lib/redis-pub-sub.provider.ts16:10-19
    #12 53.66 [tsl] ERROR in /app/libs/database/src/lib/redis-pub-sub.provider.ts(16,11)
    #12 53.66 TS2322: Type 'Redis' is not assignable to type 'RedisClient'.
    #12 53.66 Type 'Redis' is missing the following properties from type 'Redis': stream, isCluster, connector, reconnectTimeout, and 140 more.
    #12 53.66
    #12 53.66 ERROR in /app/libs/database/src/lib/redis-pub-sub.provider.ts
    #12 53.66 ./libs/database/src/lib/redis-pub-sub.provider.ts17:10-20
    #12 53.66 [tsl] ERROR in /app/libs/database/src/lib/redis-pub-sub.provider.ts(17,11)
    #12 53.66 TS2322: Type 'Redis' is not assignable to type 'RedisClient'.
    #12 53.66
    #12 53.66 ERROR in libs/database/src/lib/redis-pub-sub.provider.ts:16:11
    #12 53.66 TS2322: Type 'Redis' is not assignable to type 'RedisClient'.
    #12 53.66 Type 'Redis' is missing the following properties from type 'Redis': stream, isCluster, connector, reconnectTimeout, and 140 more.
    #12 53.66 14 | };
    #12 53.66 15 | return new RedisPubSub({
    #12 53.66 > 16 | publisher: new Redis(options),
    #12 53.66 | ^^^^^^^^^
    #12 53.66 17 | subscriber: new Redis(options),
    #12 53.66 18 | })
    #12 53.66 19 | } ,
    #12 53.66
    #12 53.66 ERROR in libs/database/src/lib/redis-pub-sub.provider.ts:17:11
    #12 53.66 TS2322: Type 'Redis' is not assignable to type 'RedisClient'.
    #12 53.66 15 | return new RedisPubSub({
    #12 53.66 16 | publisher: new Redis(options),
    #12 53.66 > 17 | subscriber: new Redis(options),
    #12 53.66 | ^^^^^^^^^^
    #12 53.66 18 | })
    #12 53.66 19 | } ,
    #12 53.66 20 | };
    #12 53.66
    #12 53.66 webpack compiled with 4 errors (b984ccb820b8363c)
    #12 53.77
    #12 53.77
    #12 53.77
    #12 53.77 > NX Running target "driver-api:build" failed
    #12 53.77
    #12 53.77 Failed tasks:
    #12 53.77
    #12 53.77 - driver-api:buildroduction
    #12 53.77
    #12 53.77 Hint: run the command with --verbose for more details.
    #12 53.77


    hata ile ilgili dosya olan "redis-pub-sub.provider.ts(16,11)" şu şekilde ;

    import { pubSubToken } from '@nestjs-query/query-graphql';
    import { RedisPubSub } from 'graphql-redis-subscriptions';
    import Redis from 'ioredis';
    import { Provider } from '@nestjs/common';

    export class RedisPubSubProvider {
    static provider(): Provider {
    return {
    provide: pubSubToken(),
    useFactory: () => {
    const options = {
    host: process.env.REDIS_HOST || 'localhost',
    port: 6379
    };
    return new RedisPubSub({
    publisher: new Redis(options),
    subscriber: new Redis(options),
    })
    } ,
    };
    }
    }


    çözebilecek arkadaşların iletişime geçmesini rica ediyorum
  • 12-12-2022, 16:56:15
    #2
    redis nerede çalışıyor, projeyi siz mi yazdınız , env dosyasında redis yolunu verdiniz mi
  • 12-12-2022, 16:59:28
    #3
    yalnizyargic adlı üyeden alıntı: mesajı görüntüle
    redis nerede çalışıyor, projeyi siz mi yazdınız , env dosyasında redis yolunu verdiniz mi
    dm gönderildi