inversify / InversifyJS

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

LAZY_IN_SYNC: Uncaught TypeError: Cannot convert a Symbol value to a string #1510

Open paul-marechal opened 1 year ago

paul-marechal commented 1 year ago

Expected Behavior

I don't expect the LAZY_IN_SYNC error to fail when displaying symbols.

Current Behavior

LAZY_IN_SYNC fails to display symbols.

Possible Solution

Call .toString() explicitly before printing the symbol.

Steps to Reproduce (for bugs)

  1. Create a binding resolving to a promise.
  2. Resolve said binding synchronously.

Context

We recently migrated to Inversify 6 and had to deal with this error.

Your Environment

paul-marechal commented 1 year ago

Maybe a different issue but I had this problem while dealing with this error: What's the recommended way to troubleshoot which binding is causing the sync resolution to fail? I ended up editing Inversify's sources in my node modules to print what service identifier caused resolvedRequests.isAsync to become true but that feels like a workaround.