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

MIDWAY_10003 循环依赖出了问题? #3197

Closed
pigLoveRabbit520 opened this issue Aug 25, 2023 · 7 comments
Closed

MIDWAY_10003 循环依赖出了问题? #3197

pigLoveRabbit520 opened this issue Aug 25, 2023 · 7 comments
Labels
No update status for a long time No update status for a long time

Comments

@pigLoveRabbit520
Copy link

pigLoveRabbit520 commented Aug 25, 2023

MidwayDefinitionNotFoundError: user in class RenderCommonService in class GameService in class ProjectImageService in class ExportTaskService in class GameOrderService in class UserService in class UserController is not valid in current context

user属性就是一个UserService

@Inject()
private user: UserService;
  • Node Version: v18.17.1
  • Midway Version(Decorator/Core): 3.10.10
  • Component Name/Version:
  • Platform: ubuntu 18
  • Mini Showcase Repository:
    @Provide我看都写了
    是因为midway版本的原因么?
@czy88840616
Copy link
Member

猜不出,先版本都拉到最新。 npx midway-version

@pigLoveRabbit520
Copy link
Author

pigLoveRabbit520 commented Aug 25, 2023

npx 通过了

✓ @midwayjs/faas-typings(not installed)
✓ @midwayjs/fc-starter(not installed)
✓ @midwayjs/serverless-http-parser(not installed)
✓ @midwayjs/async-hooks-context-manager(3.10.10)
✓ @midwayjs/axios(not installed)
✓ @midwayjs/bootstrap(3.10.10)
✓ @midwayjs/bull-board(not installed)
✓ @midwayjs/bull(not installed)
✓ @midwayjs/cache(not installed)
✓ @midwayjs/captcha(not installed)
✓ @midwayjs/casbin-redis-adapter(not installed)
✓ @midwayjs/casbin-typeorm-adapter(not installed)
✓ @midwayjs/casbin(not installed)
✓ @midwayjs/code-dye(not installed)
✓ @midwayjs/consul(not installed)
✓ @midwayjs/core(3.10.10)
✓ @midwayjs/cos(not installed)
✓ @midwayjs/cross-domain(not installed)
✓ @midwayjs/decorator(3.10.10)
✓ @midwayjs/etcd(not installed)
✓ @midwayjs/express-session(not installed)
✓ @midwayjs/faas(not installed)
✓ @midwayjs/grpc(not installed)
✓ @midwayjs/http-proxy(not installed)
✓ @midwayjs/i18n(3.10.13)
✓ @midwayjs/info(not installed)
✓ @midwayjs/jwt(not installed)
✓ @midwayjs/kafka(not installed)
✓ @midwayjs/mikro(not installed)
✓ @midwayjs/mock(3.10.13)
✓ @midwayjs/mongoose(not installed)
✓ @midwayjs/oss(not installed)
✓ @midwayjs/otel(not installed)
✓ @midwayjs/passport(not installed)
✓ @midwayjs/process-agent(not installed)
✓ @midwayjs/prometheus-socket-io(not installed)
✓ @midwayjs/prometheus(not installed)
✓ @midwayjs/rabbitmq(not installed)
✓ @midwayjs/redis(3.10.13)
✓ @midwayjs/security(not installed)
✓ @midwayjs/sequelize(not installed)
✓ @midwayjs/session(not installed)
✓ @midwayjs/socketio(not installed)
✓ @midwayjs/static-file(not installed)
✓ @midwayjs/swagger(not installed)
✓ @midwayjs/tablestore(not installed)
✓ @midwayjs/typegoose(not installed)
✓ @midwayjs/typeorm(not installed)
✓ @midwayjs/upload(not installed)
✓ @midwayjs/validate(3.10.13)
✓ @midwayjs/version(3.10.14)
✓ @midwayjs/view-ejs(not installed)
✓ @midwayjs/view-nunjucks(not installed)
✓ @midwayjs/view(not installed)
✓ @midwayjs/express(not installed)
✓ @midwayjs/koa(not installed)
✓ @midwayjs/web(3.10.13)
✓ @midwayjs/ws(not installed)

@pigLoveRabbit520
Copy link
Author

升级到最新的版本了,还是报这个错误。。

@czy88840616
Copy link
Member

如果明确有循环依赖的话,那就得业务自己解决了,可以懒加载或者抽离依赖。

@pigLoveRabbit520
Copy link
Author

不应该呀,midway不是解决了循环依赖么?

@czy88840616
Copy link
Member

逻辑层面的循环依赖我们已经处理了,但是语言层面的框架是无法处理的(比如注入这种,在一开始就导入了类,node 本身就会把后一个读到空对象,这个框架是无法处理的)。

@czy88840616 czy88840616 added the No update status for a long time No update status for a long time label Aug 31, 2023
Copy link

github-actions bot commented Dec 5, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No update status for a long time No update status for a long time
Development

No branches or pull requests

2 participants