jhipster / jhipster-core

JHipster Domain Language, used by JHipster UML and JDL-Studio to generate entities
Apache License 2.0
346 stars 116 forks source link

Using relative path for clientRootFolder in jdl failed #384

Closed christinOGH closed 4 years ago

christinOGH commented 4 years ago
Overview of the issue

I try to use a relative path for the clientRootFolder in my jdl-File. Import-jdl fails with the following error:

The JDL is being parsed. error: Error message: unexpected character: ->/<- at offset: 4403, skipped 1 characters. SyntaxError: Error: unexpected character: ->/<- at offset: 4403, skipped 1 characters. Error while parsing applications and entities from the JDL SyntaxError: Error: unexpected character: ->/<- at offset: 4403, skipped 1 characters.

SyntaxError: Error: unexpected character: ->/<- at offset: 4403, skipped 1 characters. at callApiMethod (\jhipster-core\lib\readers\jdl_reader.js:88:11) at parse (\jhipster-core\lib\readers\jdl_reader.js:72:10) at Object.parseFromFiles (\jhipster-core\lib\readers\jdl_reader.js:41:10) at parseFiles (\jhipster-core\lib\jdl\jdl_importer.js:82:20) at JDLImporter.import (\jhipster-core\lib\jdl\jdl_importer.js:64:30) at JDLProcessor.importJDL (\generator-jhipster\cli\import-jdl.js:76:41) at JDLProcessor.importJDL (\generator-jhipster\cli\import-jdl.js:296:38) at module.exports (\generator-jhipster\cli\import-jdl.js:450:21) at Command.command.allowUnknownOption.description.action.args (\generator-jhipster\cli\cli.js:72:36) at Command.listener (\commander\index.js:315:8)

Motivation for or Use Case

As the path can be a custom value it should be possible to use relative paths.

Reproduce the error

Add a realtive path for clientRootFolder in jdl and run import-jdl: clientRootFolder * with client

Related issues
JHipster Version(s)

6.3.1

JHipster configuration

{ "generator-jhipster": { "promptValues": { "packageName": "something", "nativeLanguage": "de" }, "jhipsterVersion": "6.2.0", "applicationType": "microservice", "baseName": "something", "packageName": "something", "packageFolder": "something", "serverPort": "8081", "authenticationType": "oauth2", "cacheProvider": "no", "websocket": false, "databaseType": "sql", "devDatabaseType": "postgresql", "prodDatabaseType": "postgresql", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": "consul", "buildTool": "gradle", "enableSwaggerCodegen": false, "testFrameworks": [], "jhiPrefix": "jhi", "entitySuffix": "", "dtoSuffix": "DTO", "otherModules": [], "enableTranslation": true, "clientPackageManager": "npm", "nativeLanguage": "de", "languages": [ "de" ], "blueprints": [], "skipClient": true, "skipUserManagement": true } }

Environment and Tools

java version "11.0.4" 2019-07-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)

git version 2.16.2.windows.1

node: v9.8.0

npm: 6.11.3

yeoman: 3.1.0

Docker version 19.03.2, build 6a30dfc

docker-compose version 1.24.1, build 4667896b

Browsers and Operating System

Win10

MathieuAA commented 4 years ago

Hi, please provide the full JDL file if you can. If you can't, you can send it to my email.

christinOGH commented 4 years ago

I'd like to send it per email but I can't find you email address. :/

MathieuAA commented 4 years ago

mathieu.abou-aichi@jhipster.tech It's in the package.json file :)

MathieuAA commented 4 years ago

I've received it, I'm gonna test the parser with your file.

MathieuAA commented 4 years ago

Quick update: I've tried importing it with the latest parser version: no error. Also tried with the JDL Studio from JHipster Online, no error.

What version of JHipster are you using?

christinOGH commented 4 years ago

6.3.1 is mentioned by jhipster --version. So should be the latest. However I'm wondering which version is used as in the JHipster configuration I found "jhipsterVersion": "6.2.0" The configuration was created by someone else and I never changed something there. Maybe this is necassary.

In JDL Studio I also get no error but when I execute jhipster import-jdl the mentioned error occurs.

MathieuAA commented 4 years ago

You may have two versions installed instead of one... While I don't understand why you have this issue, it may cause your problem (not sure but worth checking). I suggest you head over there, removing your current installation of the generator and reinstall it.

christinOGH commented 4 years ago

I doubled checked the JDL I sent to you. I forgot to add the relative path. So I will send you the correct version. Please can you try to import again? Sorry for the circumstances. I have removed the relative path so that I was able to work with the JDL.

MathieuAA commented 4 years ago

Roger that, I'll try again

christinOGH commented 4 years ago

Thank you :)

MathieuAA commented 4 years ago

This was a bit painful, but this is fixed :) thanks for reporting this one!

christinOGH commented 4 years ago

Thanks for your help. :)

christinOGH commented 4 years ago

One last question: Do you know when a new release of JHipster is planed? I'm looking forward to get this fix ;)

MathieuAA commented 4 years ago

I don't know, there's gonna be a major version though (for this repo).

christinOGH commented 4 years ago

Thanks