Skip to content

Commit 398fe15

Browse files
authored
fix: don't require inspector module on production env (#5228)
because of production env shouldn't use inspector module and such as vercel/pkg custom node runtime remove it. so we hope egg disable inspector on production env. closes #5226
1 parent a0ba9c3 commit 398fe15

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/egg.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const path = require('path');
33
const fs = require('fs');
44
const ms = require('ms');
55
const http = require('http');
6-
const inspector = require('inspector');
76
const EggCore = require('egg-core').EggCore;
87
const cluster = require('cluster-client');
98
const extend = require('extend2');
@@ -115,7 +114,7 @@ class EggApplication extends EggCore {
115114
isLeader: this.type === 'agent',
116115
logger: this.coreLogger,
117116
// debug mode does not check heartbeat
118-
isCheckHeartbeat: inspector.url() === undefined,
117+
isCheckHeartbeat: this.config.env === 'prod' ? true : require('inspector').url() === undefined,
119118
});
120119
const client = cluster(clientClass, options);
121120
this._patchClusterClient(client);

0 commit comments

Comments
 (0)