Search code examples
inversifyjs

Do I need reflect-metadata package with inversify if I use express and angular?


The inversify docs say

The reflect-metadata polyfill should be imported only once in your entire application because the Reflect object is mean to be a global singleton. More details about this can be found here.

If your environment don't support one of these you will need to import a shim or polyfill

I'm using LTS node+express for my server. And latest angular for my client.

So I assume:

  • I don't need it for my server project, because LTS node doesn't need these shims
  • I don't need it for my client project, because angular bundles various shims automatically

Is that correct? When would that package be needed?


Solution

  • Turns out it doesn't work on the server without this polyfill. Seems that it's necessary for inversify to work, even though I'm using the latest LTS node.