{"action":"created","issue":{"url":"https://api.github.com/repos/foxhound87/rfx-stack/issues/26","repository_url":"https://api.github.com/repos/foxhound87/rfx-stack","labels_url":"https://api.github.com/repos/foxhound87/rfx-stack/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/foxhound87/rfx-stack/issues/26/comments","events_url":"https://api.github.com/repos/foxhound87/rfx-stack/issues/26/events","html_url":"https://github.com/foxhound87/rfx-stack/issues/26","id":171936782,"number":26,"title":"Bluebird.js errors and HMR ","user":{"login":"jonandrewdavis","id":6545465,"avatar_url":"https://avatars.githubusercontent.com/u/6545465?v=3","gravatar_id":"","url":"https://api.github.com/users/jonandrewdavis","html_url":"https://github.com/jonandrewdavis","followers_url":"https://api.github.com/users/jonandrewdavis/followers","following_url":"https://api.github.com/users/jonandrewdavis/following{/other_user}","gists_url":"https://api.github.com/users/jonandrewdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/jonandrewdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonandrewdavis/subscriptions","organizations_url":"https://api.github.com/users/jonandrewdavis/orgs","repos_url":"https://api.github.com/users/jonandrewdavis/repos","events_url":"https://api.github.com/users/jonandrewdavis/events{/privacy}","received_events_url":"https://api.github.com/users/jonandrewdavis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-18T15:56:19Z","updated_at":"2016-08-18T18:53:55Z","closed_at":null,"body":"Enjoying using rfx-stack on a large project. Thank you for the work.\r\n\r\nWas looking at some past issues, but they didn't really address my specific problem.\r\n\r\nI am seeing this bluebird.js warning A LOT. to the point it's difficult to use the console. \r\n``` \r\nWarning: a promise was rejected with a non-error: [object String]\r\n    at Manager.eval (eval at <anonymous> (http://localhost:3000/bundle.js:2084:2), <anonymous>:21:15)\r\n    at Socket.eval (eval at <anonymous> (http://localhost:3000/bundle.js:2084:2), <anonymous>:21:15)\r\nFrom previous event:\r\n    at connected (eval at <anonymous> (http://localhost:3000/bundle.js:5294:2), <anonymous>:15:10)\r\nFrom previous event:\r\n    at Object.app.authenticate (eval at <anonymous> (http://localhost:3000/bundle.js:5288:2), <anonymous>:45:25)\r\n    at Array.forEach (native)\r\n    at rehydrate (eval at <anonymous> (http://localhost:3000/bundle.js:3974:2), <anonymous>:35:26)\r\n```\r\n\r\nI'm having a difficulty figuring out how to resolve these. They happen:\r\n\r\n1. when I make changes and hot reload any `pure` or `stateless` component.  That includes `stateless functional components`. \r\n2. Doesn't seem to happen on components that are hooked up to a store via `connect` \r\n\r\nI looked up this:\r\nhttp://bluebirdjs.com/docs/warning-explanations.html\r\n\r\nBut to resolve them, I'm not sure where I'd add errors or whatnot without line numbers or files. they're all `bundle.js` errors\r\n\r\nSecondly, I noticed that, `config.client.js` if I remove: \r\n\r\n```\r\n      new webpack.ProvidePlugin({\r\n        Promise: 'bluebird',\r\n        fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',\r\n      }),\r\n```\r\n\r\nIt will stop the errors. What exactly is this doing? Is it overriding the normal Promise with a `bluebird.js` promise? What's the second line doing? My app seemed to work fine without it. \r\n\r\nHow is bluebird helping? \r\n\r\nSorry for a pretty unspecific issue. Looking for help around hydration. \r\n\r\nMy basic question is: \r\n\r\n- How can I resolve these warnings? \r\n- How can I go about troubleshooting them? \r\n- Can I safely suppress them and go on with my life? How? \r\n\r\nThanks!  Hope this isn't too annoying/vague. Thanks for your work. \r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/foxhound87/rfx-stack/issues/comments/240820853","html_url":"https://github.com/foxhound87/rfx-stack/issues/26#issuecomment-240820853","issue_url":"https://api.github.com/repos/foxhound87/rfx-stack/issues/26","id":240820853,"user":{"login":"foxhound87","id":1292494,"avatar_url":"https://avatars.githubusercontent.com/u/1292494?v=3","gravatar_id":"","url":"https://api.github.com/users/foxhound87","html_url":"https://github.com/foxhound87","followers_url":"https://api.github.com/users/foxhound87/followers","following_url":"https://api.github.com/users/foxhound87/following{/other_user}","gists_url":"https://api.github.com/users/foxhound87/gists{/gist_id}","starred_url":"https://api.github.com/users/foxhound87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foxhound87/subscriptions","organizations_url":"https://api.github.com/users/foxhound87/orgs","repos_url":"https://api.github.com/users/foxhound87/repos","events_url":"https://api.github.com/users/foxhound87/events{/privacy}","received_events_url":"https://api.github.com/users/foxhound87/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T18:53:55Z","updated_at":"2016-08-18T18:53:55Z","body":"Hi @jonandrewdavis \r\n\r\nthank you for using the RFX Stack!\r\n\r\nI used `bluebird` as `polyfill` so `Promise` can work the same on every browser, whether do not support it or have a different version.\r\n\r\nThe `fetch` polyfill was moved to the entry point after `babel-polyfill` for both the client and server, fixed in this commit https://github.com/foxhound87/rfx-stack/commit/ff138bddab3d7a0cd0e76711bba9f558b1ec3b12\r\n\r\nThe `/utils/request.js` was removed too because incomplete and broken, I suggest to use something like `axios`, `superagent` or `request`.\r\n\r\nThe `Warning: a promise was rejected with a non-error` in your case is related to the `authenticate` promise and is an authentication failure, maybe you are trying to reconnect with a token that is not valid anymore. But I don't think it is related to the hot reload.\r\n\r\nAnyway you should be able to see the full error message using `.catch()` on the `authenticate()` promise like so: https://github.com/foxhound87/rfx-stack/blob/ff138bddab3d7a0cd0e76711bba9f558b1ec3b12/src/shared/stores/auth.js#L30\r\n\r\nLet me know if it helped!"}}
{"actor":{"display_login":"foxhound87"}}