angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.13k stars 1.24k forks source link

When using sequelize, npm run start:server reports a promise was passed to a then #2751

Closed zeripath closed 5 years ago

zeripath commented 5 years ago
Item Version
generator-angular-fullstack v5.0.0-rc.2
Node v10.7.0
npm 6.1.0
Operating System Ubuntu 18.04 LTS
Item Answer
Transpiler Typescript
Markup Pug
CSS SCSS
Router ngRoute
Client Tests Mocha
DB SQL
Auth Y

When using sequelize, npm run start:server reports:

(node:xxxxxx) Warning: .then() only accepts functions but was passed: [object Promise]

this happens because in server/app.js

sqldb.sequelize.sync()
    .then(wsInitPromise)

is incorrect and should be:

sqldb.sequelize.sync()
    .then(() => wsInitPromise)