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
output is like this: FATAL (resolver) Cannot resolve dependencies for anonymous function: {"message":"Component unresolvable","context":{"name":"module3","errors":[{"problemType":"notRegistered"}]}}
cool works as expected
C:\_projects\simple-ioc\lib\containerHelpers\resolver.js:22
return resolvedNonReservedDependencies[ dependency.name ];
^
TypeError: Cannot read property 'module1' of undefined
at C:\_projects\simple-ioc\lib\containerHelpers\resolver.js:22:43
at Array.map (native)
at Object.pub.resolveInjectableComponent (C:\_projects\simple-ioc\lib\containerHelpers\resolver.js:20:83)
at C:\_projects\simple-ioc\lib\containerHelpers\resolver.js:62:9
at Immediate.<anonymous> (C:\_projects\simple-ioc\lib\genericHelpers\errRerouter.js:5:5)
at Immediate.immediate._onImmediate (timers.js:409:16)
at processImmediate [as _immediateCallback] (timers.js:358:17)
it's no good because framework reports some problem with module 1 that is perfectly correct and no mention about module3
i think that in resolver.js code there is no need to check if callback exists it is good enough to check error and log it fatal if something goes wrong
pub.inject=function(store,fn,parentName,callback){varcomponent=injectableComponent.get(fn);resolveDependencies(store,'anonymousFunction',component.dependencies.nonReserved,function(err,resolvedNonReservedDependencies){if(err&&!callback)log.fatal('Cannot resolve dependencies for anonymous function',err);elsepub.resolveInjectableComponent(parentName,component,resolvedNonReservedDependencies,function(err,instance){if(callback)callback(err,instance);});});};
change like below fix problem
(...)if(err)log.fatal('Cannot resolve dependencies for anonymous function',err);elsepub.resolveInjectableComponent(parentName,component,(...)
please consider this fix and btw Can You publish newest version to npm registry? I see only 3.0.16
The text was updated successfully, but these errors were encountered:
When inject with callback is invoked there is problem with error handling ex. I have
then i have 2 cases
1 scenario:
inject
error without callbackoutput is like this:
FATAL (resolver) Cannot resolve dependencies for anonymous function: {"message":"Component unresolvable","context":{"name":"module3","errors":[{"problemType":"notRegistered"}]}}
cool works as expected
2 scenario:
inject
error with callbackoutput from this case is like this:
it's no good because framework reports some problem with module 1 that is perfectly correct and no mention about module3
i think that in resolver.js code there is no need to check if callback exists it is good enough to check error and log it fatal if something goes wrong
change like below fix problem
please consider this fix and btw Can You publish newest version to npm registry? I see only 3.0.16
The text was updated successfully, but these errors were encountered: