Closed seansabour closed 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, } }
Hi,
Which node version are you running?
ReplaceAll function was introduced in ES2021. For target ES2021 you need node version 16 or higher.
main.ts
tsconfig.json