conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Handle users not returning an object from the props function

Open micahr opened this issue 10 years ago • 1 comments

Trying to set a property in a props function, when a dependency didn't return an object causes this error which is hard to find the root cause. There should be a handler around calling the props function, which determines if this._props is undefined or not, and throws an error so users can correct the issue.

TypeError: Cannot set property 'property' of undefined
    at Object.module.exports.rc.createConductor.props [as propsFn] 
    at Conductor._mergeDeps (/restify-conductor/lib/Conductor.js:256:35)

micahr avatar Nov 23 '15 19:11 micahr

The most important part of this would be to include the parent conductor, to speed up finding the root cause.

micahr avatar Nov 23 '15 19:11 micahr