You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { Container } from "inversify";
const container = new Container();
const s = Symbol('foo');
container.bind(s).toConstantValue(null);
console.log(container.get(s));
Produces:
/project/node_modules/inversify/lib/utils/binding_utils.js:62
throw new Error(ERROR_MSGS.INVALID_BINDING_TYPE + " " + serviceIdentifierAsString);
^
Error: Invalid binding type: Symbol(foo)
at ensureFullyBound (/project/node_modules/inversify/lib/utils/binding_utils.js:62:15)
at _getResolvedFromBinding (/project/node_modules/inversify/lib/resolution/resolver.js:99:42)
at /project/node_modules/inversify/lib/resolution/resolver.js:127:22
at _resolveInScope (/project/node_modules/inversify/lib/resolution/resolver.js:121:14)
at _resolveBinding (/project/node_modules/inversify/lib/resolution/resolver.js:126:12)
at /project/node_modules/inversify/lib/resolution/resolver.js:88:20
at resolve (/project/node_modules/inversify/lib/resolution/resolver.js:225:12)
at /project/node_modules/inversify/lib/container/container.js:622:49
at Container._get (/project/node_modules/inversify/lib/container/container.js:590:38)
at Container._getButThrowIfAsync (/project/node_modules/inversify/lib/container/container.js:593:27)
The text was updated successfully, but these errors were encountered:
It's currently no longer a high priority for my projects. If I have time I might try creating a merge request that allows binding null values but understanding the code of inversofy isn't very easy...
Used to work in inversify 5
Produces:
The text was updated successfully, but these errors were encountered: