Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Yeomon CRUD Module Sub-Generator breaks project #347

Closed
coryfklein opened this issue Jan 6, 2015 · 24 comments
Closed

Yeomon CRUD Module Sub-Generator breaks project #347

coryfklein opened this issue Jan 6, 2015 · 24 comments

Comments

@coryfklein
Copy link

  1. yo meanjs
  2. grunt
  3. localhost:3000 works perfectly as expected
  4. yo meanjs:crud-module myModule
  5. Nothing loads on localhost:3000
@nanuuki
Copy link

nanuuki commented Jan 7, 2015

In which version are you experiencing this issue?

@coryfklein
Copy link
Author

I assume "latest stable", because that's what the docs say.

the Official Yo Generator, which generates the latest stable copy of the MEAN.JS boilerplate

@coryfklein
Copy link
Author

Also

$ yo --version
1.3.3

@coryfklein
Copy link
Author

This is probably obvious, but I should also mention that the yo meanjs:crud-module <module-name> step is near the beginning of the "Getting Started" guide.

@NeverOddOrEven
Copy link
Contributor

I will check this for 0.3.x. I'm working on the generator right now for 0.4.x.

@nanuuki
Copy link

nanuuki commented Jan 7, 2015

You can verify the version of the generator with npm list generator-meanjs or npm list -g generator-meanjs. Latest seems to be 0.1.12. Just to make sure you have the latest version.

Edit: updated the command, oops!

@coryfklein
Copy link
Author

Yup, mine is 0.1.12.

@nanuuki
Copy link

nanuuki commented Jan 7, 2015

Works for me w/ 0.1.12. Are there any errors when running Grunt after yo meanjs:crud-module myModule - either in the console or your browser? The page will be blank if bower install failed to install Angular for some reason.

@NeverOddOrEven
Copy link
Contributor

the crud-module generator works for me. can you check your javascript browser console for any errors?

@coryfklein
Copy link
Author

Here is the error in the javascript browser console:

Uncaught Error: Menu does not exists menus.client.service.js:40validateMenuExistance menus.client.service.js:40addMenuItem menus.client.service.js:84(anonymous function) mymodules.client.config.js:7invoke angular.js:3965(anonymous function) angular.js:3811forEach angular.js:325createInjector angular.js:3811doBootstrap angular.js:1444bootstrap angular.js:1459(anonymous function) application.js:19trigger angular.js:2573(anonymous function) angular.js:2853forEach angular.js:325eventHandler

@coryfklein
Copy link
Author

screen shot 2015-01-07 at 12 36 36 pm

@coryfklein
Copy link
Author

This is right after running this command:

➜  advancement git:(master) ✗ yo meanjs:crud-module myModule
? Which supplemental folders would you like to include in your angular module?
? Would you like to add the CRUD module links to a menu? Yes
? What is your menu identifier(Leave it empty and press ENTER for the default "topbar" menu)? myModule
   create app/controllers/mymodules.server.controller.js
   create app/models/mymodule.server.model.js
   create app/routes/mymodules.server.routes.js
   create app/tests/mymodule.server.model.test.js
   create app/tests/mymodule.server.routes.test.js
   create public/modules/mymodules/config/mymodules.client.routes.js
   create public/modules/mymodules/controllers/mymodules.client.controller.js
   create public/modules/mymodules/services/mymodules.client.service.js
   create public/modules/mymodules/tests/mymodules.client.controller.test.js
   create public/modules/mymodules/config/mymodules.client.config.js
   create public/modules/mymodules/views/create-mymodule.client.view.html
   create public/modules/mymodules/views/edit-mymodule.client.view.html
   create public/modules/mymodules/views/list-mymodules.client.view.html
   create public/modules/mymodules/views/view-mymodule.client.view.html
   create public/modules/mymodules/mymodules.client.module.js

@coryfklein
Copy link
Author

No errors from grunt:

  advancement git:(master) ✗ grunt
Running "jshint:all" (jshint) task
>> 66 files lint free.

Running "csslint:all" (csslint) task
>> 2 files lint free.

Running "concurrent:default" (concurrent) task
Running "nodemon:dev" (nodemon) task
Running "watch" task
Waiting...
[nodemon] v1.2.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: app/views/**/*.* gruntfile.js server.js config/**/*.js app/**/*.js
[nodemon] starting `node --debug server.js`
debugger listening on port 5858
NODE_ENV is not defined! Using default development environment
MEAN.JS application started on port 3000
GET / 304 36.206 ms - -
GET /lib/bootstrap/dist/css/bootstrap.css 304 9.363 ms - -
GET /modules/core/css/core.css 304 9.623 ms - -
GET /lib/bootstrap/dist/css/bootstrap-theme.css 304 10.627 ms - -
GET /modules/users/css/users.css 304 7.526 ms - -
GET /lib/angular/angular.js 304 12.851 ms - -
GET /lib/angular-resource/angular-resource.js 304 9.945 ms - -
GET /lib/angular-cookies/angular-cookies.js 304 7.490 ms - -
GET /lib/angular-animate/angular-animate.js 304 7.572 ms - -
GET /lib/angular-touch/angular-touch.js 304 8.054 ms - -
GET /lib/angular-sanitize/angular-sanitize.js 304 7.899 ms - -
GET /lib/angular-ui-utils/ui-utils.js 304 7.111 ms - -
GET /lib/angular-bootstrap/ui-bootstrap-tpls.js 304 8.611 ms - -
GET /lib/angular-ui-router/release/angular-ui-router.js 304 10.509 ms - -
GET /config.js 304 8.358 ms - -
GET /modules/articles/articles.client.module.js 304 8.661 ms - -
GET /application.js 304 9.282 ms - -
GET /modules/core/core.client.module.js 304 9.298 ms - -
GET /modules/mymodules/mymodules.client.module.js 304 8.827 ms - -
GET /modules/users/users.client.module.js 304 8.742 ms - -
GET /modules/articles/config/articles.client.config.js 304 5.953 ms - -
GET /modules/articles/controllers/articles.client.controller.js 304 5.853 ms - -
GET /modules/articles/config/articles.client.routes.js 304 7.159 ms - -
GET /modules/articles/services/articles.client.service.js 304 22.398 ms - -
GET /modules/core/controllers/header.client.controller.js 304 22.554 ms - -
GET /modules/core/config/core.client.routes.js 304 22.988 ms - -
GET /modules/core/controllers/home.client.controller.js 304 25.651 ms - -
GET /modules/core/services/menus.client.service.js 304 9.526 ms - -
GET /modules/mymodules/config/mymodules.client.config.js 304 9.228 ms - -
GET /modules/mymodules/config/mymodules.client.routes.js 304 9.910 ms - -
GET /modules/mymodules/services/mymodules.client.service.js 304 9.536 ms - -
GET /modules/mymodules/controllers/mymodules.client.controller.js 304 11.537 ms - -
GET /modules/users/config/users.client.config.js 304 9.261 ms - -
GET /modules/users/controllers/authentication.client.controller.js 304 8.769 ms - -
GET /modules/users/config/users.client.routes.js 304 9.208 ms - -
GET /modules/users/controllers/password.client.controller.js 304 6.432 ms - -
GET /modules/users/controllers/settings.client.controller.js 304 6.394 ms - -
GET /modules/users/services/authentication.client.service.js 304 6.378 ms - -
GET /modules/users/services/users.client.service.js 304 3.523 ms - -
GET /modules/core/img/brand/favicon.ico 304 3.284 ms - -

@coryfklein
Copy link
Author

screen shot 2015-01-07 at 12 40 13 pm

Looks like the conditional if(this.menus[menuId]) fails because this.menus legitimately doesn't have a 'myModule' property. However, it doesn't have an articles property for the built-in articles module either.

@coryfklein
Copy link
Author

In firefox I also get an error about livereload:

screen shot 2015-01-07 at 12 44 00 pm

@nanuuki
Copy link

nanuuki commented Jan 7, 2015

Seems like you set an invalid menu (if you haven't modified anything); ? What is your menu identifier(Leave it empty and press ENTER for the default "topbar" menu)? myModule. Instead of myModule try with the default (topbar) and see if that helps.

@nanuuki
Copy link

nanuuki commented Jan 7, 2015

Note that the menu ids are in no way related to you app names.

@NeverOddOrEven
Copy link
Contributor

@coryfklein, @nanuuki is correct. The app is boilerplated with only one pre-existing menu. Use "topbar"

@coryfklein
Copy link
Author

That resolved the problem.

I read What is your menu identifier as asking me what I wanted the item to be named in the top menu bar. My bad.

@NeverOddOrEven
Copy link
Contributor

No problem. Glad it's resolved.

@Microns
Copy link

Microns commented May 9, 2015

I just made the exact same mistake. Maybe the wording in the generator prompt should be changed in the future?

@GPnow
Copy link

GPnow commented May 29, 2015

made the exact same mistake

@coryfklein
Copy link
Author

@GPnow Maybe submit a pull request?

@vbabaria
Copy link

using "yo meanjs" version 1.4.7, creating crud module still doesn't show up on topbar - would appreciate any suggestion? - thanks

i tried "topbar" as suggested by earlier comments, regenerated all files, restarted grunt but new module doesn't show up on the browser

bash-3.2# yo meanjs:crud-module superheroes
Which supplemental folders would you like to include in your angular module? css, img, directives, filters
What is your menu identifier(Leave it empty and press ENTER for the default "topbar" menu)? topbar

create app/controllers/superheroes.server.controller.js
create app/models/superhero.server.model.js
create app/routes/superheroes.server.routes.js
create app/tests/superhero.server.model.test.js
create app/tests/superhero.server.routes.test.js
create public/modules/superheroes/config/superheroes.client.routes.js
create public/modules/superheroes/controllers/superheroes.client.controller.js
create public/modules/superheroes/services/superheroes.client.service.js
create public/modules/superheroes/tests/superheroes.client.controller.test.js
create public/modules/superheroes/config/superheroes.client.config.js
create public/modules/superheroes/views/create-superhero.client.view.html
create public/modules/superheroes/views/edit-superhero.client.view.html
create public/modules/superheroes/views/list-superheroes.client.view.html
create public/modules/superheroes/views/view-superhero.client.view.html
create public/modules/superheroes/superheroes.client.module.js

pdfowler pushed a commit to pdfowler/mean that referenced this issue Jan 19, 2016
pdfowler pushed a commit to pdfowler/mean that referenced this issue Jan 19, 2016
… mobile/develop

# By Rykov Serge
# Via Rykov Serge
* 'mobile/develop' of bitbucket.org:outset_inc/outset:
  profile display name changed
  add activity issues done meanjs#345, meanjs#346, meanjs#347, 363
  meanjs#347, added new field distance driven, saving it to props.
  fixed isue when we add custom truck and there is no logo for it, displaying text, if there is a logo - displaying only logo
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants