{"action":"created","issue":{"url":"https://api.github.com/repos/FormidableLabs/radium/issues/300","labels_url":"https://api.github.com/repos/FormidableLabs/radium/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/FormidableLabs/radium/issues/300/comments","events_url":"https://api.github.com/repos/FormidableLabs/radium/issues/300/events","html_url":"https://github.com/FormidableLabs/radium/issues/300","id":98265414,"number":300,"title":"Unique key error being swallowed in resolveStyles","user":{"login":"ryan1234","id":1672337,"avatar_url":"https://avatars.githubusercontent.com/u/1672337?v=3","gravatar_id":"","url":"https://api.github.com/users/ryan1234","html_url":"https://github.com/ryan1234","followers_url":"https://api.github.com/users/ryan1234/followers","following_url":"https://api.github.com/users/ryan1234/following{/other_user}","gists_url":"https://api.github.com/users/ryan1234/gists{/gist_id}","starred_url":"https://api.github.com/users/ryan1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryan1234/subscriptions","organizations_url":"https://api.github.com/users/ryan1234/orgs","repos_url":"https://api.github.com/users/ryan1234/repos","events_url":"https://api.github.com/users/ryan1234/events{/privacy}","received_events_url":"https://api.github.com/users/ryan1234/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-30T21:09:32Z","updated_at":"2015-08-04T23:00:34Z","closed_at":null,"body":"Context: Our React app had components that were rendering as null with no warnings or errors in the console. We traced it down to not adding keys on some elements that use Radium styles. The easy fix of course is to just add a key. =)\r\n\r\nThe problem is that the error that is _supposed_ to be bubbled to the console got swallowed somewhere along the way making life unpleasant.\r\n\r\nForgive the crudeness of my initial testing ... after installing the npm module, I went to `./node_modules/radium/lib/resolve-styles.js` and added two throw statements:\r\n\r\n```{javascript}\r\nvar resolveStyles = function resolveStyles(component, // ReactComponent, flow+eslint complaining\r\nrenderedElement, // ReactElement\r\nexistingKeyMap) {\r\n  // ReactElement\r\n  existingKeyMap = existingKeyMap || {};\r\n\r\n  //throw new Error('before');\r\n\r\n  if (!renderedElement || renderedElement.props && renderedElement.props._radiumDidResolveStyles) {\r\n    return renderedElement;\r\n  }\r\n\r\n  throw new Error('after');\r\n\r\n  // Recurse over children first in case we bail early. Note that children only\r\n  // include those rendered in `this` component. Child nodes in other components\r\n  // will not be here, so each component needs to use Radium.\r\n  var newChildren;\r\n  var oldChildren = renderedElement.props.children;\r\n```\r\n\r\nThe first error will bubble to the console. The second error gets swallowed ... somewhere. The error that talks about missing keys is a bit down in this function. I need a way to have it bubble up so I know what's going on.\r\n\r\nUsing Babel 5.8.19 and Radium 0.13.5. Decorating with `@Radium`. "},"comment":{"url":"https://api.github.com/repos/FormidableLabs/radium/issues/comments/127789405","html_url":"https://github.com/FormidableLabs/radium/issues/300#issuecomment-127789405","issue_url":"https://api.github.com/repos/FormidableLabs/radium/issues/300","id":127789405,"user":{"login":"ryan1234","id":1672337,"avatar_url":"https://avatars.githubusercontent.com/u/1672337?v=3","gravatar_id":"","url":"https://api.github.com/users/ryan1234","html_url":"https://github.com/ryan1234","followers_url":"https://api.github.com/users/ryan1234/followers","following_url":"https://api.github.com/users/ryan1234/following{/other_user}","gists_url":"https://api.github.com/users/ryan1234/gists{/gist_id}","starred_url":"https://api.github.com/users/ryan1234/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryan1234/subscriptions","organizations_url":"https://api.github.com/users/ryan1234/orgs","repos_url":"https://api.github.com/users/ryan1234/repos","events_url":"https://api.github.com/users/ryan1234/events{/privacy}","received_events_url":"https://api.github.com/users/ryan1234/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T23:00:34Z","updated_at":"2015-08-04T23:00:34Z","body":"I've spent the day trying to reproduce it in a small demo app and haven't been successful. I can reproduce it well in my work codebase, but not in the demo app.\r\n\r\nMy best guess at this point is something working with promises is swallowing the error. Maybe not Radium, but something else.\r\n\r\nWhat I would love is to have a verbose debug mode with Radium that I can turn on that writes errors to the console in addition to throwing them. That way there is no chance of them being swallowed. =)\r\n\r\nI'll keep looking though ..."}}