Skip to content

Commit 6d94af5

Browse files
ielponetmicalevisk
authored andcommitted
fix: snapshot injection in case of adapter usage
1 parent 0420353 commit 6d94af5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/loader.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ module.exports.loader = function loader(devtoolsRegisterOpts) {
4242

4343
NestFactory.create = function create(...args) {
4444
// create(module, options)
45+
// create(module, httpAdapter)
4546
// create(module, httpAdapter, options)
46-
const optsIdx = args.length === 3 ? 2 : 1
47+
let optsIdx = 1;
48+
if(args.length === 3 || (args.length === 2 && typeof args[1] === "object" && Object.getPrototypeOf(args[1].constructor).name === "AbstractHttpAdapter")){
49+
optsIdx = 2;
50+
}
4751

4852
/** @type {import('@nestjs/common').NestApplicationOptions} */
4953
const optsToMerge = {

0 commit comments

Comments
 (0)