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
If multiple node modules have dependencies on 'reflect-metadata' and modules are installed redundantly, metadata is erased after later require('reflect-metadata') is invoked.
Assume that using module Foo and Bar, they're using reflect-metadata
npm package tree looks like below
|─ Foo
| └ [email protected]
|─ Bar
└ [email protected]
One of my own decorators save something by invoking Reflect.defineMetadata() and another module imports Bar module, so another reflect-metadata module is initialized.
On initialization, reflect-metadata patches its own functions to global Reflect object.
On second initialization, it may overwrite functions, but internal Metadata object will be lost.
I've avoided this problem by specifying same semver version in package.json. latest npm (ver>=3) does not install redundantly.
|─ Foo
| └ [email protected]
|─ Bar
But for the case modules should use different versions or one of them is maintained by others,
it would be great to copy internal Metadata values
The text was updated successfully, but these errors were encountered:
Unfortunately, even if I address this in a later release it is possible an earlier release would still overwrite the members if it is loaded after the earlier later release.
If multiple node modules have dependencies on 'reflect-metadata' and modules are installed redundantly, metadata is erased after later require('reflect-metadata') is invoked.
Assume that using module Foo and Bar, they're using reflect-metadata
npm package tree looks like below
|─ Foo
| └ [email protected]
|─ Bar
└ [email protected]
One of my own decorators save something by invoking Reflect.defineMetadata() and another module imports Bar module, so another reflect-metadata module is initialized.
On initialization, reflect-metadata patches its own functions to global Reflect object.
On second initialization, it may overwrite functions, but internal Metadata object will be lost.
I've avoided this problem by specifying same semver version in package.json. latest npm (ver>=3) does not install redundantly.
|─ Foo
| └ [email protected]
|─ Bar
But for the case modules should use different versions or one of them is maintained by others,
it would be great to copy internal Metadata values
The text was updated successfully, but these errors were encountered: