Open fnguye1 opened 8 years ago
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?
:+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.
Here'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.
module.exports
. Your modules should reveal the minimum interface and only expose things that must be used by other modules.*Sync
calls anywhere in your code, and no require
calls except at the top of each module file."dependencies"
. When installing dependencies, use the --save
option: npm install --save somepackage
.req
or res
into a reusable composable middleware: (req, res, next)=>{}
.isLoggedIn
or equivalent route middleware: app.post('/post/:postId', isLoggedIn, ...)
Spend a lot of times to debug, but could not complete due to issues:
TypeError: Invalid attempt to destructure non-iterable instance at c:\Users\fnguye1\Desktop\Node\My-Projects\assignment3\routes.js:5:586 at Object.callee$1$0$ (c:/Users/fnguye1/Desktop/Node/My-Projects/assignment3/routes.js:136:64) at tryCatch (c:\Users\fnguye1\AppData\Roaming\npm\node_modules\babel\node_modules\regenerator\runtime.js:61:40) at GeneratorFunctionPrototype.invoke as _invoke at GeneratorFunctionPrototype.prototype.(anonymous function) as next at GeneratorFunctionPrototype.invoke (c:\Users\fnguye1\AppData\Roaming\npm\node_modules\babel\node_modules\regenerator\runtime.js:136:37) at run (c:\Users\fnguye1\AppData\Roaming\npm\node_modules\babel\node_modules\core-js\modules\es6.promise.js:104:47) at c:\Users\fnguye1\AppData\Roaming\npm\node_modules\babel\node_modules\core-js\modules\es6.promise.js:115:28 at flush (c:\Users\fnguye1\AppData\Roaming\npm\node_modules\babel\node_modules\core-js\modules\$.microtask.js:19:5) at nextTickCallbackWith0Args (node.js:433:9) at process._tickDomainCallback (node.js:403:13)