InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

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

Open paul-marechal opened this issue 2 years ago • 1 comments

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

  • Version used: 6.0.1
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Firefox 113.0.2 (64-bit)
  • Operating System and version (desktop or mobile): Windows 10
  • Link to your project: https://github.com/eclipse-theia/theia

paul-marechal avatar May 26 '23 21:05 paul-marechal

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.

paul-marechal avatar May 26 '23 22:05 paul-marechal