Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Retrieving Entries from a Table

Thomas Dimnet
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Thomas Dimnet
Python Development Techdegree Graduate 43,629 Points

Error when running npm start..

Hello There,

I followed the tutorial step by step and its seems that a problem occurs when updating the database or creating new article.

Here is what I have within my console:

Unhandled rejection ReferenceError: article is not defined
    at /Users/thomasdimnet/Documents/workspace/Sequelize-Blog/routes/articles.js:15:33
    at tryCatcher (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/promise.js:693:18)
    at Async._drainQueue (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/thomasdimnet/Documents/workspace/Sequelize-Blog/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

The second problem is when I look at the documentation, the course seems a bit outdated. Is it only me or is it a general problem?

For now I am trying to find another article or tutorial in order to work with the sequelize ORM ...

Did you find a solution for this? Similar problem here.

1 Answer

Thomas Dimnet
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Thomas Dimnet
Python Development Techdegree Graduate 43,629 Points

Hello JustDave,

I find two possibilities for this error:

  • The first one is that the db file is not present at the beginning of the course and it may causes this error;
  • The second one is the new version of Sequelize which is not fully compatible with the project.

Anyway, I finally made it work :). Here is the link of the project built on my github account: https://github.com/tdimnet/Sequelize-Blog.git It will maybe help you to understand what's wrong.

Thanks Thomas, appreciate it!