jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.53k stars 4.02k forks source link

TypeError using jhipster:import-jdl for simple entity using jhipster 3.1.0 #3441

Closed kyriakoy closed 8 years ago

kyriakoy commented 8 years ago

Trrying to use yo jhipster:import-jdl yourJdlFile.jh with a simple entity produce an error:

The jdl is being imported. TypeError: Cannot read property 'endsWith' of undefined at Generator.getAngularAppName (/usr/lib/node_modules/generator-jhipster/generators/generator-base.js:1229:61) at module.exports.EntityGenerator.extend.initializing.getConfig (/usr/lib/node_modules/generator-jhipster/generators/entity/index.js:126:40) at Object. (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/base.js:436:25) at /usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/node_modules/run-async/index.js:26:25 at /usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/node_modules/run-async/index.js:25:19 at /usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/base.js:448:8 at tryOnImmediate (timers.js:534:15) at processImmediate as _immediateCallback

simple entity jdl I am using:

entity D {
  name String required,
  address String required maxlength(100),
  age Integer required min(18)
}

I am using Jhipster v3.1.0 Ubuntu 14.04 nodejs v5.10.1 npm 3.8.3 yo 1.7.0

deepu105 commented 8 years ago

What is the yo-rc.json for the project where you are running this On 22 Apr 2016 20:51, "kyriakoy" notifications@github.com wrote:

Trrying to use yo jhipster:import-jdl yourJdlFile.jh with a simple entity produce an error:

The jdl is being imported. TypeError: Cannot read property 'endsWith' of undefined at Generator.getAngularAppName (/usr/lib/node_modules/generator-jhipster/generators/generator-base.js:1229:61) at module.exports.EntityGenerator.extend.initializing.getConfig (/usr/lib/node_modules/generator-jhipster/generators/entity/index.js:126:40) at Object. (/usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/base.js:436:25) at /usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/node_modules/run-async/index.js:26:25 at /usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/node_modules/run-async/index.js:25:19 at /usr/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/base.js:448:8 at tryOnImmediate (timers.js:534:15) at processImmediate as _immediateCallback

simple entity jdl I am using:

entity D { name String required, address String required maxlength(100), age Integer required min(18) }

I am using Jhipster v3.1.0 Ubuntu 14.04 nodejs v5.10.1 npm 3.8.3 yo 1.7.0

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/3441

kyriakoy commented 8 years ago

There is no .yo-rc.json into the project folder

deepu105 commented 8 years ago

You can use import-jdl only from a project generated by JHipster. Plz read the documentation properly

lenzirodrigo commented 8 years ago

Hi @deepu105 I'm getting the same error with a simple model defined in a jh file. Can you please point the documentation you are referring to? There is no reference to a yo-rc.json in the jdl documentation and following the quick start there is no instructions other than: Model your entities with JDL Studio and generate them with yo jhipster:import-jdl yourJdlFile.jh

deepu105 commented 8 years ago

Dude its a sub generator you should generate a project using JHipster first in order to use it. you seem to have skip the first 3 steps in the quick start On 25 Apr 2016 07:10, "lenzirodrigo" notifications@github.com wrote:

Hi @deepu105 https://github.com/deepu105 I'm getting the same error with a simple model defined in a jh file. Can you please point the documentation you are referring to? There is no reference to a yo-rc.json in the jdl documentation https://jhipster.github.io/jdl/ and following the quick start there is no instructions other than: Model your entities with JDL Studio and generate them with yo jhipster:import-jdl yourJdlFile.jh

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/3441#issuecomment-214063552

wnbaq commented 8 years ago

I have same problem, I am trying to import JDL and I definetly run Jhipster. But It couldn't produce entities in my project. I just take this:

C:\Users\PER\alo>yo jhipster:import-jdl jhipster-jdl.jh The jdl is being imported.

C:\Users\PER\alo>

My yo-rc.json is: { "generator-jhipster": { "jhipsterVersion": "3.4.1", "baseName": "alo", "packageName": "com.mycompany.myapp", "packageFolder": "com/mycompany/myapp", "serverPort": "8080", "authenticationType": "session", "hibernateCache": "ehcache", "clusteredHttpSession": "no", "websocket": "no", "databaseType": "sql", "devDatabaseType": "mysql", "prodDatabaseType": "mysql", "searchEngine": "no", "buildTool": "maven", "enableSocialSignIn": false, "rememberMeKey": "596620c1e6cb3dee257f152d8792b4156147f170", "useSass": false, "applicationType": "monolith", "testFrameworks": [ "gatling" ], "jhiPrefix": "jhi", "enableTranslation": false } } Edit:jhipster-jdl.jh is downloaded from default JDL Studio.

deepu105 commented 8 years ago

@wnbaq this is a closed issue. please open a new one with details required if you have an issue

Ankitprasad7658 commented 1 year ago

I am getting this error in Jhipster while Importing JDL. Error during import-jdl: TypeError: Cannot read property 'setOptions' of undefined

deepu105 commented 1 year ago

Do you have the right NodeJS LTS version?

On Mon, 13 Mar 2023, 07:49 Ankit Prasad, @.***> wrote:

I am getting this error in Jhipster while Importing JDL. Error during import-jdl: TypeError: Cannot read property 'setOptions' of undefined

— Reply to this email directly, view it on GitHub https://github.com/jhipster/generator-jhipster/issues/3441#issuecomment-1465597915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIOKF7KSPTP2XSNBJS6UWTW327OXANCNFSM4CBWKHMA . You are receiving this because you were mentioned.Message ID: @.***>

amarpatel-xx commented 1 year ago

@Ankitprasad7658 Check your JDL, please. You must be defining an entity but it does not exist in the entity list (for example in the microservices list). I had the same error, setOptions of undefined. I was referencing an entity in my microservices definitions which did not exist.

jdl:

entity EntityA { id UUID, ... }

entity EntityB { id UUID, ... }

microservice EntityA, EntityB, EntityC with siennaservice

Notice EntityC does not exist; thus, the error.

Ankitprasad7658 commented 11 months ago

@amarpatel-xx

Thanks its working now. i was missing entity in entity list. Thank you so much!