Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on first launch #2561

Closed
rXp opened this issue May 11, 2017 · 13 comments · Fixed by #2576
Closed

Error on first launch #2561

rXp opened this issue May 11, 2017 · 13 comments · Fixed by #2576

Comments

@rXp
Copy link

rXp commented May 11, 2017

I just installed everything and setup everything correctly with no error.
Now I started Webstorm and use "gulp serve" this is the errors that appeared although the website seems to work partly.

"C:\Program Files\JetBrains\WebStorm 2017.1.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" C:\Users\***\WebstormProjects\AngularFS\node_modules\gulp\bin\gulp.js --color --gulpfile C:\Users\***\WebstormProjects\AngularFS\gulpfile.babel.js serve
[16:01:19] Requiring external module babel-register
[16:01:29] Using gulpfile ~\WebstormProjects\AngularFS\gulpfile.babel.js
[16:01:29] Starting 'serve'...
[16:01:29] Starting 'clean:tmp'...
[16:01:29] Starting 'lint:scripts'...
[16:01:29] Starting 'lint:scripts:client'...
[16:01:29] Starting 'lint:scripts:server'...
[16:01:29] Starting 'inject'...
[16:01:29] Starting 'inject:less'...
[16:01:29] Starting 'copy:fonts:dev'...
[16:01:29] Starting 'env:all'...
[16:01:29] Finished 'env:all' after 47 ms
[16:01:29] Starting 'typings'...
[16:01:31] Finished 'clean:tmp' after 1.75 s
[16:01:31] [gulp-tslint] error (no-use-before-declare) polyfills.ts[21, 5]: variable 'ENV' used before declaration
[16:01:31] [gulp-tslint] error (whitespace) polyfills.ts[21, 3]: missing whitespace
[16:01:31] [gulp-tslint] error (whitespace) polyfills.ts[25, 3]: missing whitespace
[16:01:33] gulp-inject 4 files into app.less.
[16:01:33] Finished 'inject:less' after 3.84 s
[16:01:33] Finished 'inject' after 3.84 s
[16:01:33] [gulp-tslint] error (whitespace) app/app.ts[58, 11]: missing whitespace
[16:01:33] [gulp-tslint] error (no-trailing-whitespace) app/account/index.ts[3, 42]: trailing whitespace
[16:01:34] [gulp-tslint] error (class-name) components/auth/auth.service.ts[6, 7]: Class name must be in pascal case
[16:01:34] [gulp-tslint] error (whitespace) components/auth/auth.service.ts[28, 5]: missing whitespace
[16:01:35] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[7, 7]: missing whitespace
[16:01:35] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[11, 7]: missing whitespace
[16:01:35] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[13, 11]: missing whitespace
[16:01:35] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[25, 11]: missing whitespace
[16:01:36] Finished 'copy:fonts:dev' after 6.51 s
[16:01:36] Finished 'typings' after 6.75 s
[16:01:36] 
C:\Users\***\WebstormProjects\AngularFS\server\config\seed.js
  50:5  error  Unreachable code  no-unreachable

C:\Users\***\WebstormProjects\AngularFS\server\sqldb\index.js
  7:8  error  'path' is defined but never used  no-unused-vars

C:\Users\***\WebstormProjects\AngularFS\server\api\thing\thing.events.js
  22:25  error  'Thing' is already declared in the upper scope  no-shadow

C:\Users\***\WebstormProjects\AngularFS\server\api\user\user.events.js
  22:25  error  'User' is already declared in the upper scope  no-shadow

C:\Users\***\WebstormProjects\AngularFS\server\api\user\user.model.js
  110:13  error    Unexpected alias '_this' for 'this'             consistent-this
  113:13  error    Expected return with your callback function     callback-return
  117:13  error    Expected return with your callback function     callback-return
  119:13  error    Expected return with your callback function     callback-return
  132:19  error    'args' is defined but never used                no-unused-vars
  137:19  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  138:22  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  140:26  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  141:22  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  152:13  error    Expected return with your callback function     callback-return
  184:15  error    Expected return with your callback function     callback-return

✖ 15 problems (11 errors, 4 warnings)

[16:01:36] Finished 'lint:scripts:server' after 7.21 s
[16:01:36] [gulp-tslint] error (whitespace) app/account/settings/settings.controller.ts[28, 7]: missing whitespace
[16:01:36] [gulp-tslint] error (no-trailing-whitespace) app/account/signup/signup.controller.ts[48, 58]: trailing whitespace
[16:01:36] [gulp-tslint] error (whitespace) app/account/signup/signup.controller.ts[33, 7]: missing whitespace
[16:01:36] [gulp-tslint] error (whitespace) app/account/signup/signup.controller.ts[47, 11]: missing whitespace
[16:01:36] Finished 'lint:scripts:client' after 7.31 s
[16:01:36] Finished 'lint:scripts' after 7.31 s
[16:01:36] Starting 'start:server'...
[16:01:36] Finished 'start:server' after 18 ms
[16:01:36] Starting 'start:client'...
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: C:\Users\***\WebstormProjects\AngularFS\server/**/*
[nodemon] starting `node server`
[BS] Proxying: http://localhost:9000
[BS] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://172.27.60.213:3000
 --------------------------------------
          UI: http://localhost:3002
 UI External: http://172.27.60.213:3002
 --------------------------------------
finished populating things
Express server listening on 9000, in development mode
[16:01:52] Finished 'start:client' after 16 s
[16:01:52] Starting 'watch'...
[16:01:52] Finished 'watch' after 214 ms
[16:01:52] Finished 'serve' after 23 s
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
webpack: wait until bundle finished: /
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
Error: ENOENT: no such file or directory, stat 'C:\Users\***\WebstormProjects\AngularFS\client\index.html'
GET / 404 41.122 ms - 248
GET / 404 431.045 ms - 248
GET / 404 435.423 ms - 248
GET / 404 330.939 ms - 248
GET / 404 339.271 ms - 248
GET / 404 440.227 ms - 248
GET / 404 372.276 ms - 248
GET / 404 400.078 ms - 248
GET / 404 405.027 ms - 248
GET / 404 390.855 ms - 248
GET / 404 395.341 ms - 248
GET / 404 376.679 ms - 248
webpack done hook
Hash: c61fe232a3a5bc4fc424
Version: webpack 1.15.0
Time: 12882ms
                  Asset     Size  Chunks             Chunk Names
          app.bundle.js   475 kB       0  [emitted]  app
    polyfills.bundle.js   211 kB       1  [emitted]  polyfills
       vendor.bundle.js  2.42 MB       2  [emitted]  vendor
      app.bundle.js.map   622 kB       0  [emitted]  app
polyfills.bundle.js.map   271 kB       1  [emitted]  polyfills
   vendor.bundle.js.map  2.83 MB       2  [emitted]  vendor
   ../client/index.html  1.39 kB          [emitted]  
Child html-webpack-plugin for "..\client\index.html":
                   Asset    Size  Chunks       Chunk Names
    ../client/index.html  2.7 kB       0       
webpack: Compiled successfully.
[default] Checking started in a separate process...
SocketIO / [127.0.0.1:53851] CONNECTED
GET /api/things 200 114.279 ms - -
[default] C:/Users/***/WebstormProjects/AngularFS/client/components/auth/auth.service.ts:3:8 
    Module '"lodash"' has no default export.
[default] C:/Users/***/WebstormProjects/AngularFS/client/components/auth/auth.service.ts:192:14 
    Supplied parameters do not match any signature of call target.
SocketIO / [127.0.0.1:53851] DISCONNECTED
SocketIO / [127.0.0.1:53899] CONNECTED
(node:2396) Warning: a promise was created in a handler but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.bind (C:\Users\***\WebstormProjects\AngularFS\node_modules\bluebird\js\release\bind.js:65:20)
GET /api/things 304 86.733 ms - -
GET /api/users 401 35.854 ms - 539
UnauthorizedError: jwt malformed
    at C:\Users\***\WebstormProjects\AngularFS\node_modules\express-jwt\lib\index.js:102:22
    at C:\Users\***\WebstormProjects\AngularFS\node_modules\jsonwebtoken\verify.js:27:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
(node:2396) Warning: a promise was created in a handler but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.bind (C:\Users\***\WebstormProjects\AngularFS\node_modules\bluebird\js\release\bind.js:65:20)
GET /api/things 304 53.821 ms - -
GET /api/users 401 29.114 ms - 539
UnauthorizedError: jwt malformed
    at C:\Users\***\WebstormProjects\AngularFS\node_modules\express-jwt\lib\index.js:102:22
    at C:\Users\***\WebstormProjects\AngularFS\node_modules\jsonwebtoken\verify.js:27:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
(node:2396) Warning: a promise was created in a handler but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.bind (C:\Users\***\WebstormProjects\AngularFS\node_modules\bluebird\js\release\bind.js:65:20)
GET /api/things 304 49.081 ms - -

@Awk34
Copy link
Member

Awk34 commented May 11, 2017

Can you successfully log in and view the list of users?

@rXp
Copy link
Author

rXp commented May 11, 2017

@Awk34 No I can't.
With the admin account and the test account I get the error : "The email is not registered".

I am on Windows 10 64b. Is there some node that is not compatible with windows ?

@Awk34
Copy link
Member

Awk34 commented May 11, 2017

It's recommended to be using something like Node 6.4.x or above

@rXp
Copy link
Author

rXp commented May 11, 2017

@Awk34
I have Node JS 7.10 and I'm not using Mongo I am using a relational database.
Is there any special file that I need to config ?

@Awk34
Copy link
Member

Awk34 commented May 11, 2017

This would all have been helpful information. Please fill this out:

Item | Version
----- | -----
generator-angular-fullstack | x.x.x
Node | x.x.x
npm | x.x.x
Operating System | OS X 10 / Windows 10 / Ubuntu 15.10 / etc
etc | etc

Item | Answer
----- | -----
Transpiler | Babel / TypeScript
Markup | HTML / Pug
CSS | CSS / LESS / SCSS / Stylus
Router | ngRoute / ui-router
Client Tests | Jasmine / Mocha
DB | MongoDB / SQL
Auth | Y / N
etc | etc

@rXp
Copy link
Author

rXp commented May 11, 2017

@Awk34 Yes sorry about that its been a long week

Item Version
generator-angular-fullstack latest master (11 May 2017)
Node 7.10.0
npm 4.2.0
Operating System Windows 10 64b
Item Answer
Transpiler TypeScript
Markup HTML
CSS LESS
Router ngRoute
Client Tests Jasmine
DB SQL
Auth Y

I use the latest version of Webstorm for my IDE but I installed everything myself without Webstorm.

@rXp
Copy link
Author

rXp commented May 12, 2017

I've fix an issue with postgresql now the tables are created and two of them are filled.
But now the Users table is not filled and there are still a number of errors :

"C:\Program Files\JetBrains\WebStorm 2017.1.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" C:\Users\***\WebstormProjects\AngularFS\node_modules\gulp\bin\gulp.js --color --gulpfile C:\Users\***\WebstormProjects\AngularFS\gulpfile.babel.js serve
[09:21:30] Requiring external module babel-register
[09:21:53] Using gulpfile ~\WebstormProjects\AngularFS\gulpfile.babel.js
[09:21:53] Starting 'serve'...
[09:21:53] Starting 'clean:tmp'...
[09:21:53] Starting 'lint:scripts'...
[09:21:53] Starting 'lint:scripts:client'...
[09:21:53] Starting 'lint:scripts:server'...
[09:21:54] Starting 'inject'...
[09:21:54] Starting 'inject:less'...
[09:21:54] Starting 'copy:fonts:dev'...
[09:21:54] Starting 'env:all'...
[09:21:54] Finished 'env:all' after 80 ms
[09:21:54] Starting 'typings'...
[09:21:56] Finished 'clean:tmp' after 3.01 s
[09:21:58] [gulp-tslint] error (no-use-before-declare) polyfills.ts[21, 5]: variable 'ENV' used before declaration
[09:21:58] [gulp-tslint] error (whitespace) polyfills.ts[21, 3]: missing whitespace
[09:21:58] [gulp-tslint] error (whitespace) polyfills.ts[25, 3]: missing whitespace
[09:22:01] gulp-inject 4 files into app.less.
[09:22:01] Finished 'inject:less' after 7.61 s
[09:22:01] Finished 'inject' after 7.61 s
[09:22:02] [gulp-tslint] error (whitespace) app/app.ts[58, 11]: missing whitespace
[09:22:03] [gulp-tslint] error (class-name) components/auth/auth.service.ts[6, 7]: Class name must be in pascal case
[09:22:03] [gulp-tslint] error (whitespace) components/auth/auth.service.ts[28, 5]: missing whitespace
[09:22:03] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[7, 7]: missing whitespace
[09:22:03] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[11, 7]: missing whitespace
[09:22:03] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[13, 11]: missing whitespace
[09:22:03] [gulp-tslint] error (whitespace) components/auth/router.decorator.ts[25, 11]: missing whitespace
[09:22:06] [gulp-tslint] error (no-trailing-whitespace) app/account/index.ts[3, 42]: trailing whitespace
[09:22:06] Finished 'copy:fonts:dev' after 12 s
[09:22:06] Finished 'typings' after 13 s
[09:22:07] [gulp-tslint] error (whitespace) app/account/settings/settings.controller.ts[28, 7]: missing whitespace
[09:22:07] 
C:\Users\***\WebstormProjects\AngularFS\server\sqldb\index.js
  7:8  error  'path' is defined but never used  no-unused-vars

C:\Users\***\WebstormProjects\AngularFS\server\config\seed.js
  50:5  error  Unreachable code  no-unreachable

C:\Users\***\WebstormProjects\AngularFS\server\api\thing\thing.events.js
  22:25  error  'Thing' is already declared in the upper scope  no-shadow

C:\Users\***\WebstormProjects\AngularFS\server\api\user\user.events.js
  22:25  error  'User' is already declared in the upper scope  no-shadow

C:\Users\***\WebstormProjects\AngularFS\server\api\user\user.model.js
  110:13  error    Unexpected alias '_this' for 'this'             consistent-this
  113:13  error    Expected return with your callback function     callback-return
  117:13  error    Expected return with your callback function     callback-return
  119:13  error    Expected return with your callback function     callback-return
  132:19  error    'args' is defined but never used                no-unused-vars
  137:19  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  138:22  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  140:26  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  141:22  warning  Use the rest parameters instead of 'arguments'  prefer-rest-params
  152:13  error    Expected return with your callback function     callback-return
  184:15  error    Expected return with your callback function     callback-return

✖ 15 problems (11 errors, 4 warnings)

[09:22:07] Finished 'lint:scripts:server' after 13 s
[09:22:07] [gulp-tslint] error (no-trailing-whitespace) app/account/signup/signup.controller.ts[48, 58]: trailing whitespace
[09:22:07] [gulp-tslint] error (whitespace) app/account/signup/signup.controller.ts[33, 7]: missing whitespace
[09:22:07] [gulp-tslint] error (whitespace) app/account/signup/signup.controller.ts[47, 11]: missing whitespace
[09:22:07] Finished 'lint:scripts:client' after 14 s
[09:22:07] Finished 'lint:scripts' after 14 s
[09:22:07] Starting 'start:server'...
[09:22:07] Finished 'start:server' after 31 ms
[09:22:07] Starting 'start:client'...
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: C:\Users\***\WebstormProjects\AngularFS\server/**/*
[nodemon] starting `node server`
[BS] Proxying: http://localhost:9000
[BS] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://172.27.60.213:3000
 --------------------------------------
          UI: http://localhost:3002
 UI External: http://172.27.60.213:3002
 --------------------------------------
webpack: wait until bundle finished: /socket.io-client/?EIO=3&transport=polling&t=LlxYRzO
webpack: wait until bundle finished: /
Executing (default): DELETE FROM "Things"
Executing (default): INSERT INTO "Things" ("_id","name","info") VALUES (DEFAULT,'Development Tools','Integration with popular tools such as Webpack, Gulp, Babel, TypeScript, Karma, Mocha, ESLint, Node Inspector, Livereload, Protractor, Pug, Stylus, Sass, and Less.'),(DEFAULT,'Server and Client integration','Built with a powerful and fun stack: MongoDB, Express, AngularJS, and Node.'),(DEFAULT,'Smart Build System','Build system ignores `spec` files, allowing you to keep tests alongside code. Automatic injection of scripts and styles into your index.html'),(DEFAULT,'Modular Structure','Best practice client and server structures allow for more code reusability and maximum scalability'),(DEFAULT,'Optimized Build','Build process packs up your templates as a single JavaScript payload, minifies your scripts/css/images, and rewrites asset names for caching.'),(DEFAULT,'Deployment Ready','Easily deploy your app to Heroku or Openshift with the heroku and openshift subgenerators');
finished populating things
Express server listening on 9000, in development mode
[09:22:49] Finished 'start:client' after 42 s
[09:22:49] Starting 'watch'...
webpack: wait until bundle finished: /
[09:22:50] Finished 'watch' after 359 ms
[09:22:50] Finished 'serve' after 56 s
webpack: wait until bundle finished: /
webpack done hook
[default] Checking started in a separate process...
Hash: c61fe232a3a5bc4fc424
Version: webpack 1.15.0
Time: 24320ms
                  Asset     Size  Chunks             Chunk Names
          app.bundle.js   475 kB       0  [emitted]  app
    polyfills.bundle.js   211 kB       1  [emitted]  polyfills
       vendor.bundle.js  2.42 MB       2  [emitted]  vendor
      app.bundle.js.map   622 kB       0  [emitted]  app
polyfills.bundle.js.map   271 kB       1  [emitted]  polyfills
   vendor.bundle.js.map  2.83 MB       2  [emitted]  vendor
   ../client/index.html  1.39 kB          [emitted]  
Child html-webpack-plugin for "..\client\index.html":
                   Asset    Size  Chunks       Chunk Names
    ../client/index.html  2.7 kB       0       
webpack: Compiled successfully.
SocketIO / [127.0.0.1:62540] CONNECTED
SocketIO / [127.0.0.1:62562] CONNECTED
Executing (default): SELECT "data" FROM "Sessions" AS "Session" WHERE "Session"."sid" = 'YtYeL7SPx4s2kc6c9xJ1P4qcxXJ1xqXR' LIMIT 1;
(node:5304) Warning: a promise was created in a handler but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.bind (C:\Users\***\WebstormProjects\AngularFS\node_modules\bluebird\js\release\bind.js:65:20)
Executing (default): SELECT "_id", "name", "info", "active" FROM "Things" AS "Thing";
Executing (default): SELECT "id", "sid", "data" FROM "Sessions" AS "Session" WHERE "Session"."sid" = 'ajlqajMZ5ZSSF1IvkWVSORjWLdBDmAQN' LIMIT 1;
Executing (default): INSERT INTO "Sessions" ("id","sid","data") VALUES (DEFAULT,'ajlqajMZ5ZSSF1IvkWVSORjWLdBDmAQN','{"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"},"_csrfSecret":"ybda5OrDJgEaUw=="}') RETURNING *;
GET /api/things 304 937.244 ms - -
[default] C:/Users/***/WebstormProjects/AngularFS/client/components/auth/auth.service.ts:3:8 
    Module '"lodash"' has no default export.
[default] C:/Users/***/WebstormProjects/AngularFS/client/components/auth/auth.service.ts:192:14 
    Supplied parameters do not match any signature of call target.
Executing (default): SELECT "data" FROM "Sessions" AS "Session" WHERE "Session"."sid" = 'ajlqajMZ5ZSSF1IvkWVSORjWLdBDmAQN' LIMIT 1;
(node:5304) Warning: a promise was created in a handler at C:\Users\***\WebstormProjects\AngularFS\node_modules\express\lib\router\layer.js:95:5 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.bind (C:\Users\***\WebstormProjects\AngularFS\node_modules\bluebird\js\release\bind.js:65:20)
Executing (default): SELECT "_id", "name", "email", "role", "password", "provider", "salt" FROM "Users" AS "User" WHERE "User"."email" = '[email protected]' LIMIT 1;
POST /auth

@Awk34
Copy link
Member

Awk34 commented May 12, 2017

You say you scaffolded with auth enabled?

Hmm, I'm not seeing the users getting populated from server/config/seed.js. I see this:

Executing (default): DELETE FROM "Things"
Executing (default): INSERT INTO "Things" ("_id","name","info") VALUES (DEFAULT,'Development Tools','Integration with popular tools such as Webpack, Gulp, Babel, TypeScript, Karma, Mocha, ESLint, Node Inspector, Livereload, Protractor, Pug, Stylus, Sass, and Less.'),(DEFAULT,'Server and Client integration','Built with a powerful and fun stack: MongoDB, Express, AngularJS, and Node.'),(DEFAULT,'Smart Build System','Build system ignores `spec` files, allowing you to keep tests alongside code. Automatic injection of scripts and styles into your index.html'),(DEFAULT,'Modular Structure','Best practice client and server structures allow for more code reusability and maximum scalability'),(DEFAULT,'Optimized Build','Build process packs up your templates as a single JavaScript payload, minifies your scripts/css/images, and rewrites asset names for caching.'),(DEFAULT,'Deployment Ready','Easily deploy your app to Heroku or Openshift with the heroku and openshift subgenerators');
finished populating things

but nothing about seeding users. Please check the seed.js file

@rXp
Copy link
Author

rXp commented May 13, 2017

@Awk34

User.destroy({ where: {} })
      .then(() => User.bulkCreate([{
        provider: 'local',
        name: 'Test User',
        email: '[email protected]',
        password: 'test'
      }, {
        provider: 'local',
        role: 'admin',
        name: 'Admin',
        email: '[email protected]',
        password: 'admin'
      }])
        .then(() => console.log('finished populating users'))
        .catch(err => console.log('error populating users', err)));

The issue is that there is a return for Squelize for Thing, so I removed it to have the users created.
Now I also fixed the import of lodash in the client part of the app but there still several issue with one beeing when an admin is identified.

@rXp
Copy link
Author

rXp commented May 14, 2017

@Awk34 I solved the problem :)
In file

auth.service.ts

The error was that hasRole need one role and does not accept ... I just had to modify the call to Auth.hasRole for the issue to go away.
The other problems are ESLint ones which is not bad.

isAdmin(...args) { return Auth.hasRole(Reflect.apply([].concat, ['admin'], args)); },

Line 191 - 193 : auth.service.ts

@rXp rXp closed this as completed May 17, 2017
Awk34 added a commit that referenced this issue May 17, 2017
@Awk34 Awk34 reopened this May 17, 2017
@Awk34
Copy link
Member

Awk34 commented May 17, 2017

This should fix this then, correct?

#2576

@rXp
Copy link
Author

rXp commented May 17, 2017

These are the changes I made for it to be fixed :
at : /client/components/auth/auth.service.ts
I changed import _ from 'lodash'; into import * as _ from 'lodash';

at : /client/components/auth/auth.service.ts
I changed isAdmin(...args) { return Auth.hasRole(...Reflect.apply([].concat, ['admin'], args)); },into isAdmin(...args) { return Auth.hasRole(Reflect.apply([].concat, ['admin'], args)); },

@rmnguleria
Copy link

Thanks a lot @rXp .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants