Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(core): make get() throw for implicitly request-scoped trees#15865

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@JoeNutt
Copy link
Contributor

Here’s a concise PR body you can paste:

Treat non-static dependency trees as scoped in get(); instruct consumers to use resolve().

Adds focused tests under NestApplicationContext spec to cover implicit request scope via enhancers.

Closes#15836.

PR Checklist

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Calling module.get on a class whose dependency tree is implicitly non-static (e.g., due to a request‑scoped pipe/guard) returns a prototype-only instance with undefined injections, rather than throwing. Users don’t get guidance to use resolve().
Issue Number:#15836

What is the new behavior?

module.get now throws InvalidClassScopeException for non-static dependency trees (implicit request scope), instructing users to use resolve(). module.resolve continues to instantiate per-context correctly. Added tests to cover both get (throws) and resolve (works).

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

  • Core change: abstract-instance-resolver.ts (guard in find to also check !wrapperRef.isDependencyTreeStatic()).
  • Tests: nest-application-context.spec.ts (two specs under “implicit request scope via enhancers”).

Treat non-static dependency trees as scoped in get(); instruct consumers to use resolve().\n\nAdds focused tests under NestApplicationContext spec to cover implicit request scope via enhancers.\n\nClosesnestjs#15836.
@coveralls
Copy link

Pull Request Test Coverage Report forBuild 513890a5-e0b5-48f6-83b7-3f896faedccc

Details

  • 0 of0 changed or added relevant lines in0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to88.939%

TotalsCoverage Status
Change from baseBuild addc9f43-f31d-4145-9327-14d30a76e998:0.01%
Covered Lines:7325
Relevant Lines:8236

💛 -Coveralls

@kamilmysliwieckamilmysliwiec merged commit5170e60 intonestjs:masterNov 14, 2025
2 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

missing injection token increateTestingModule causes undefined controller dependencies

3 participants

@JoeNutt@coveralls@kamilmysliwiec

[8]ページ先頭

©2009-2025 Movatter.jp