inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.02k stars 712 forks source link

Rebind is broke when upgraded from v5 to v6 #1514

Open nitzcard opened 1 year ago

nitzcard commented 1 year ago

I tried upgrading from inversify 5 to 6, and now I see all the .rebind in my system do not work properly. The entity being rebinded, but when consumed thought another class later on, it still gets the first binding of the class.

illustration:

di.bind('config').toConstantValue(7)
di.rebind('config').toConstantValue(8)
di.resolve('classThatUsingConfig') => config = 7

expected: config = 8 inside classThatUsingConfig

weyert commented 7 months ago

Did you ever found a solution for this?

Jameskmonger commented 7 months ago

Thanks for the report @nitzcard @weyert, I will investigate this and aim to resolve in the 6.0.3 release.

weyert commented 7 months ago

@Jameskmonger Thank you, that would be great.