Giter Site home page Giter Site logo

Comments (7)

B4nan avatar B4nan commented on September 2, 2024 3

I was just about to write the same but realized what the issue is about. The decorator wraps given method but it won't return its return value.

The return value is ignored on this line:

await originalMethod.apply(context, args);

Anyway, next time please share some code when filing a bug report, this is not the right way to do it...

from nestjs.

B4nan avatar B4nan commented on September 2, 2024 2

4.3.1 is out, sry it took so long, i always forget about this package (and always get notifications like this when i am away from laptop) 🤷

from nestjs.

Langstra avatar Langstra commented on September 2, 2024

It is unclear what your intentions are exactly. Could you create a repository with a reproduction of the bug? That is much easier to debug then these steps to reproduce.

from nestjs.

SimoneDagna avatar SimoneDagna commented on September 2, 2024

The "problem" is also in RequestContext class from Mikro-Orm project:
https://github.com/mikro-orm/mikro-orm/blob/7e7427335a005bb379509a9a9e86a01c44a21e07/packages/core/src/utils/RequestContext.ts#L37-L42

the return type is Promise<void>, so even modifying the line:

await originalMethod.apply(context, args);

the UseRequestContext decorator will be unable to return the original method result.

from nestjs.

jearangoo avatar jearangoo commented on September 2, 2024

can this fix be included into a new version in npm?

from nestjs.

B4nan avatar B4nan commented on September 2, 2024

Oh right, forgot to release it - I don't have time for this right now but will ship it early next week.

But the method is really a simple one, nothing special in it, so you can just copy the code to your project and use your (fixed) implementation instead.

from nestjs.

jearangoo avatar jearangoo commented on September 2, 2024

no problem, thank you very much @B4nan

from nestjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.