jhipster / generator-jhipster-nodejs

A NodeJS blueprint that creates the backend using NestJS
https://www.npmjs.com/package/generator-jhipster-nodejs
Apache License 2.0
257 stars 80 forks source link

Uncaught TypeError: Cannot read property 'endsWith' of undefined #5

Closed hadirsa closed 5 years ago

hadirsa commented 5 years ago

Reproduce the error

running Travis build https://travis-ci.org/hadirsa/generator-jhipster-nodejs/builds/546741512

Link to PR (if any)

https://github.com/jhipster/generator-jhipster-nodejs/pull/4

I get the error below running the build in Travis:


  1) Subgenerator server of nodejs JHipster blueprint
       Sample test
         "before all" hook:
     Uncaught TypeError: Cannot read property 'endsWith' of undefined
      at module.exports.getAngularAppName (node_modules/generator-jhipster/generators/generator-base.js:1586:56)
      at module.exports.configureGlobal (node_modules/generator-jhipster/generators/server/index.js:369:44)
      at Object.<anonymous> (node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:424:27)
      at /home/travis/build/hadirsa/generator-jhipster-nodejs/node_modules/run-async/index.js:25:25
      at new Promise (<anonymous>)
      at /home/travis/build/hadirsa/generator-jhipster-nodejs/node_modules/run-async/index.js:24:19
      at self.env.runLoop.add.completed (node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:425:13)

is this bug or something? @amanganiello90

ghost commented 5 years ago

Hi @hadirsa, the error is lunched in the test phase. The root case is that the baseName variable of the application is not defined. In fact in the generator-base.js file there is a check on the baseName.

Now I will review your PR, but probably I will change the Roadmap for technical issue. The jhipster framework doesn't allow to override the two basic app questions (applicationType and appName). So we have to define new questions and not keep the retrocompatibility. So check soon the updated Roadmap file.