-
Notifications
You must be signed in to change notification settings - Fork 92
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
NestJS decorators stop working if a module with Paginate decorator isn't imported first #864
Comments
Please take a look at the README: https://github.com/ppetzold/nestjs-paginate?tab=readme-ov-file#code In there you can see that there are 2 steps:
Your code does not seem to have these steps implemented properly. Feel free to ask more questions! :) |
I think you didn't understand the problem or maybe I didn't convey it clearly, I use this lib in all my projects and works good, but you can try it yourself or use my example, you need only to create a Module containing controllers without using this lib, and make that Module import first in your main Module, and see every controllers of your entire application that don't use this lib stopping work. |
Ok, could you show your example as a complete minimal reproducible example? I'll link an explanation on MREs https://stackoverflow.com/help/minimal-reproducible-example In its current form I can't tell what you mean from the code, and a text description of code is hard to follow 😅
Could you do this for me and share a link to the repository, so that I can execute the code and see it in action? Thanks! |
I don't know if nestjs-paginate should work like this, but all controllers of any Module that don't have any Paginate decorators give undefined value in nestjs decorators like @Body, @param, @query and @Req ... when import first than Module that have Paginate decorators, I create a simple example of that
in a app.module.ts
WithoutPaginateModule imports first than WithPaginateModule, so all nestjs decorators from WithoutPaginateModule controllers get undefined value, importing WithPaginateModule first, everything works. Should the sequence of imports really matter? Did I forget something?
here example https://github.com/renatosantos0611/nestjs-paginate-query-issue
Thanks for help ;D
The text was updated successfully, but these errors were encountered: