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

最新版无法获取config.default.js中通过config.cluster配置的端口号 #280

Open
Chengxj1 opened this issue Dec 18, 2024 · 1 comment
Labels

Comments

@Chengxj1
Copy link

egg-bin最新版本通过egg-bin dev启动项目,config.default.js中进行了如下配置
image
但是项目启动时显示为
image
切换egg-bin版本至5.19.0通过egg-bin dev启动项目,config配置和上述一致
项目端口显示正常
image

@fengmk2
Copy link
Member

fengmk2 commented Dec 18, 2024

egg-bin v6 应该有 bug,可以来尝试修复一下

@fengmk2 fengmk2 added the bug label Dec 18, 2024
fengmk2 pushed a commit to eggjs/utils that referenced this issue Jan 8, 2025
egg-bin v6 版本启动项目时,[无法读到 cluster.listen.port
的配置](eggjs/bin#280)

原因是 [egg-bin 6.13.0](eggjs/bin#278) 版本引入了
egg-utils v4,而 v4 在查找 egg-core 包时,包名从写死的 `egg-core` 改成了 `@eggjs/core`,如果
eggjs 版本没跟上,子依赖 egg-core 没升级,egg-utils 就会查找失败

<img width="2069" alt="截图_280f31b0-8db9-4fa3-9fdc-a17975625c5e"
src="https://github.com/user-attachments/assets/d6b91d54-0ea3-4733-b9aa-a03e9aac1621"
/>


一种可能的解决方法是同时查找两个包名,如 PR 内容所示

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
	- Improved module import logic for the Egg framework
- Enhanced backward compatibility with different module naming
conventions
	- Streamlined error handling for module imports

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants