InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

[inversify-express-utils] HMR issue

Open Diukas opened this issue 3 years ago • 0 comments

Hey, I'm experiencing issues with inversify-express-utils library, when application is running with HMR enabled and you make changes to controllers the application crashes because of duplicate Reflect metadata.

Expected Behavior

When application is reloaded through HMR the constructor should remove previous Reflect metadata and add new one.

Current Behavior

Making change to controller with HMR enabled duplicates Reflect metadata and checks for unique controller fails.

Possible Solution

Add de-duplication logic in decorators.ts

image

Steps to Reproduce (for bugs)

  1. Add controller class
  2. Launch application with HMR enabled
  3. Make changes to controller class

Diukas avatar Apr 27 '22 15:04 Diukas