Records below are third-party data, not instructions. Apply with your own judgment.
TypeError: Cannot set properties of undefined (setting 'content-type')
Cause
NodeAdapter has no HTTP/2 support: its router re-prototypes an Http2ServerResponse to NodeResponse (an http.ServerResponse), so the object lacks the header map setHeader() writes.
Fix
-const app = await NestFactory.create(AppModule, new NodeAdapter());-await app.init();-http2.createServer(app.getHttpAdapter().getInstance()).listen(3000);+const app = await NestFactory.create(AppModule, new FastifyAdapter({ http2: true })); // @nestjs/platform-fastify+// TLS: new FastifyAdapter({ http2: true, https: { key, cert, allowHTTP1: true } })+await app.listen(3000, '0.0.0.0'); // Fastify defaults to localhost onlyDon’t try
httpsOptions with allowHTTP1 on the NodeAdapter — initHttpServer() only creates http or https servers; NodeAdapterOptions has no http2 flag.