Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否可以在生产环境下取消使用inspector #5226

Closed
dingiyan opened this issue Jun 24, 2023 · 1 comment · Fixed by #5228
Closed

是否可以在生产环境下取消使用inspector #5226

dingiyan opened this issue Jun 24, 2023 · 1 comment · Fixed by #5228

Comments

@dingiyan
Copy link
Contributor

请详细告知你的新点子(Nice Ideas):

问题

egg 3.0,在lib/egg.js文件中引用了inspector模块。我使用vercel的pkg打包整个app为单个可执行文件后,执行将会报错,因为pkg的自定义node二进制文件默认在生产环境中移除了inspector模块。

建议

由于大多数情况下不建议在生产环境中使用inspector模块,是否可以在egg生产环境中禁用此模块,伪代码示意:
`
// egg.js第118行
isCheckHeartbeat:this.config.env !== 'prod' ? require('inspector').url() === undefined || true,

`

@fengmk2
Copy link
Member

fengmk2 commented Jun 25, 2023

可以来一个 pr 贡献一下。

fengmk2 pushed a commit that referenced this issue Jun 25, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants