-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Dynamic module promises in the exports
array is broken
#13733
Comments
Hey, let me try and work on it |
@Kelvin-ui-hub go ahead. PRs are more than welcomed |
Okay thanks |
@kamilmysliwiec can we just drop this feature in the next major release as it never worked anyway? |
Sounds good @micalevisk. Would you like to create a PR for this? |
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Current behavior
Since the commit be6d90a#diff-10d05a74883d097e0c5b94c8564bd68b26cfcc9c57b32e3e0c0024c9e91c3e88 (nestjs v6), the following is supposed to work but it doesn't:
it crashes with the following error:
we can easily see that this is either a missing feature or a regression.
Minimum reproduction code
https://gitlab.com/micalevisk/nestjs-issue-13733
Steps to reproduce
Expected behavior
I tested it with nestjs v6, v7 (with a different error), v8, v9, v10 so I'm pretty sure that this was never supported besides what the type definition says.
I found that after testing the
ConditionalModule
feature with dynamic modules returning promises. I never saw anyone reporting this error before so I'd say that this is not common pattern at all.I tried to fix this but due to the async nature I didn't managed to fix it easily.
So instead of starting supporting it now in v10, I'd rather prefer to drop the
Promise<DynamicModule>
type fromexports
in NestJS v11. Or just drop it now in v10 because it doesn't seem to be used anyway.If anyone starting asking for such fix in <=v10, we could suggest them to use
exports: [YourDynamicModule]
instead and tell them that this is not a feature but a wrong type definition.Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.3.9
Packages versions
N/A
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: