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

fix: await the .modules of nested Elysia instances #549

Merged
merged 1 commit into from Mar 18, 2024

Conversation

aleclarson
Copy link
Contributor

If we don't await the promisedModules (previously known as lazyLoadModules) within the Elysia#_use method, we will erroneously call Elysia#compile before all nested plugins have loaded.

This PR also introduces a new internal primitive called PromiseGroup. We don't want to keep all the plugin promises in memory forever, so that we can await the plugin promises within Elysia#_use and call _use again afterwards without fearing an endless loop. The PromiseGroup ensures no endless loop can occur.

@SaltyAom SaltyAom merged commit ff9c1d3 into elysiajs:main Mar 18, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants