You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importElysiafrom'elysia'classPlugin{constructor(){console.log('init Plugin')}}constplugin=()=>newElysia({name: 'plugin'}).decorate('plugin',newPlugin())newElysia().use(plugin).use(plugin).use(plugin).onStart(({ server })=>{console.log(`Server is running at ${server?.url.toString()}`)}).listen(3000)
What is the expected behavior?
init Plugin
Server is running at http://localhost:3000/
What do you see instead?
init Plugin
init Plugin
init Plugin
Server is running at http://localhost:3000/
Additional information
No response
Have you try removing the node_modules and bun.lockb and try again yet?
Yes
The text was updated successfully, but these errors were encountered:
If you define the plugin instance as const plugin = new Elysia() instead of as a function const plugin = () => new Elysia() then it appears to work as intended.
That said, I would still expect the deduplication to work with a function, unless there's a reason to suggest otherwise. It appears to act as if the deduplication isn't running when the plugin is a function instead of an instance of Elysia.
I recommend not using the function though. Is there a reason why you would want to?
What version of Elysia is running?
1.2.10
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?Yes
The text was updated successfully, but these errors were encountered: