{"action":"created","issue":{"url":"https://api.github.com/repos/fnguye1/My-Projects/issues/4","labels_url":"https://api.github.com/repos/fnguye1/My-Projects/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/fnguye1/My-Projects/issues/4/comments","events_url":"https://api.github.com/repos/fnguye1/My-Projects/issues/4/events","html_url":"https://github.com/fnguye1/My-Projects/issues/4","id":125866867,"number":4,"title":"[Node.js FastTrack] Assignment 3: Blogger - Ready for Review","user":{"login":"fnguye1","id":16532738,"avatar_url":"https://avatars.githubusercontent.com/u/16532738?v=3","gravatar_id":"","url":"https://api.github.com/users/fnguye1","html_url":"https://github.com/fnguye1","followers_url":"https://api.github.com/users/fnguye1/followers","following_url":"https://api.github.com/users/fnguye1/following{/other_user}","gists_url":"https://api.github.com/users/fnguye1/gists{/gist_id}","starred_url":"https://api.github.com/users/fnguye1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnguye1/subscriptions","organizations_url":"https://api.github.com/users/fnguye1/orgs","repos_url":"https://api.github.com/users/fnguye1/repos","events_url":"https://api.github.com/users/fnguye1/events{/privacy}","received_events_url":"https://api.github.com/users/fnguye1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-11T03:27:23Z","updated_at":"2016-01-11T23:19:14Z","closed_at":null,"body":"Spend a lot of times to debug, but could not complete due to issues:\r\n\r\nTypeError: Invalid attempt to destructure non-iterable instance\r\n   at c:\\Users\\fnguye1\\Desktop\\Node\\My-Projects\\assignment3\\routes.js:5:586\r\n   at Object.callee$1$0$ (c:/Users/fnguye1/Desktop/Node/My-Projects/assignment3/routes.js:136:64)\r\n   at tryCatch (c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\regenerator\\runtime.js:61:40)\r\n   at GeneratorFunctionPrototype.invoke [as _invoke] (c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\regenerator\\runtime.js:328:22)\r\n   at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\regenerator\\runtime.js:94:21)\r\n   at GeneratorFunctionPrototype.invoke (c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\regenerator\\runtime.js:136:37)\r\n   at run (c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\core-js\\modules\\es6.promise.js:104:47)\r\n   at c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\core-js\\modules\\es6.promise.js:115:28\r\n   at flush (c:\\Users\\fnguye1\\AppData\\Roaming\\npm\\node_modules\\babel\\node_modules\\core-js\\modules\\$.microtask.js:19:5)\r\n   at nextTickCallbackWith0Args (node.js:433:9)\r\n   at process._tickDomainCallback (node.js:403:13)"},"comment":{"url":"https://api.github.com/repos/fnguye1/My-Projects/issues/comments/170729530","html_url":"https://github.com/fnguye1/My-Projects/issues/4#issuecomment-170729530","issue_url":"https://api.github.com/repos/fnguye1/My-Projects/issues/4","id":170729530,"user":{"login":"codepathreview","id":7917093,"avatar_url":"https://avatars.githubusercontent.com/u/7917093?v=3","gravatar_id":"","url":"https://api.github.com/users/codepathreview","html_url":"https://github.com/codepathreview","followers_url":"https://api.github.com/users/codepathreview/followers","following_url":"https://api.github.com/users/codepathreview/following{/other_user}","gists_url":"https://api.github.com/users/codepathreview/gists{/gist_id}","starred_url":"https://api.github.com/users/codepathreview/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codepathreview/subscriptions","organizations_url":"https://api.github.com/users/codepathreview/orgs","repos_url":"https://api.github.com/users/codepathreview/repos","events_url":"https://api.github.com/users/codepathreview/events{/privacy}","received_events_url":"https://api.github.com/users/codepathreview/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T23:19:14Z","updated_at":"2016-01-11T23:19:14Z","body":"When I run the code in your project to reproduce the error above, all Requireds are working. I'm going to mark this as complete. **Are you still seeing the `TypeError: Invalid attempt to destructure non-iterable instance` error locally?**\r\n\r\n--\r\n\r\n:+1: nice work. The goal of this assignment was to learn how to implement local authentication, interact with a data store, and render a webUI. In addition, you explored using middleware to faciliate common HTTP functionality. Over the next few weeks, we'll be focusing on more complex integrations and realtime functionality that we find in modern APIs and web apps.\r\n\r\nHere's a checklist of things that I'm looking for in this project. You should review the checklist, and make any changes to your project, if necessary.\r\n\r\n- Review the properties and methods that you've made available through your various `module.exports`. Your modules should reveal the minimum interface and only expose things that must be used by other modules.\r\n- There should be no `*Sync` calls anywhere in your code, and no `require` calls except at the top of each module file.\r\n- All required dependencies should be declared in the package.json `\"dependencies\"`. When installing dependencies, use the `--save` option: `npm install --save somepackage`.\r\n- Keep your code DRY by refactoring all code interacting with `req` or `res` into a reusable composable middleware: `(req, res, next)=>{}`.\r\n- Your Models should exist each in their own module file, and Mongo embedded objects should have their own Schema. It is okay to include an embedded object's schema in the same file if it's not used in other schemas.\r\n- Be sure to validate all user inputs. First, through strict enforcements in your data schemas, and second in your user, post and comment creation routes. Never rely solely on your schema for validation.\r\n- All routes requiring a user account should enforce authentication through the `isLoggedIn` or equivalent route middleware: `app.post('/post/:postId', isLoggedIn, ...)`\r\n- When handling user authentication data, security is paramount. Never store plain-text passwords anywhere, and always be sure to use at least a global salt (pepper) when hashing."}}