Redningsselskapet / nestjs-plugins

Plugins for NestJS framework
ISC License
27 stars 22 forks source link

TypeError: subject.replaceAll is not a function #36

Closed seansabour closed 1 year ago

seansabour commented 1 year ago

main.ts

async function bootstrap() {
  const options: CustomStrategy = {
    strategy: new NatsJetStreamServer({
      connectionOptions: {
        servers: 'localhost:4222',
        name: 'some-name',
      },
      consumerOptions: {
        deliverGroup: 'myservice-group',
        durable: 'mydurable-service',
        deliverTo: 'myservice-messages',
        manualAck: true,
      },
    }),
  };
  const app = await NestFactory.createMicroservice<MicroserviceOptions>(
    AppModule,
    options,
  );

  await app.listen();
}

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2021",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": false,
    "noFallthroughCasesInSwitch": false,

  }
}
kenguru33 commented 1 year ago

Hi,

Which node version are you running?

ReplaceAll function was introduced in ES2021. For target ES2021 you need node version 16 or higher.