Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Retrieving Entries from a Table

Thomas Dimnet
.a{fill-rule:evenodd;}techdegree seal-36
Thomas Dimnet
Python Development Techdegree Graduate 43,623 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
.a{fill-rule:evenodd;}techdegree seal-36
Thomas Dimnet
Python Development Techdegree Graduate 43,623 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!