InversifyJS
InversifyJS copied to clipboard
LAZY_IN_SYNC: Uncaught TypeError: Cannot convert a Symbol value to a string
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)
- Create a binding resolving to a promise.
- 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
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.