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.54k stars 4.02k forks source link

`jhipster jdl reactive-mf.jdl` no longer works with v8 #23660

Closed mraible closed 1 year ago

mraible commented 1 year ago
Overview of the issue

I tried my micro frontends tutorials with the latest main branch. It no longer works.

Motivation for or Use Case

Vintage tutorials should still work with the latest release.

Reproduce the error
jhipster jdl reactive-mf.jdl --monorepository --workspaces

Results in:


        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
                            https://www.jhipster.tech
Welcome to JHipster v8.0.0-beta.3

INFO! Generating jdls reactive-mf.jdl
ERROR! An error occured while running jhipster:jdl#downloadJdlFiles
ERROR! ERROR! /Users/mraible/Downloads/mfr/reactive-mf.jdl doesn't exist
Error: /Users/mraible/Downloads/mfr/reactive-mf.jdl doesn't exist
    at MemFsEditor.read (file:///Users/mraible/dev/generator-jhipster/node_modules/mem-fs-editor/dist/actions/read.js:8:15)
    at JdlGenerator.readDestination (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-generator/dist/actions/fs.js:49:24)
    at file:///Users/mraible/dev/generator-jhipster/dist/generators/jdl/generator.mjs:94:35
    at Array.map (<anonymous>)
    at JdlGenerator.downloadJdlFiles (file:///Users/mraible/dev/generator-jhipster/dist/generators/jdl/generator.mjs:93:84)
    at JdlGenerator.executeTask (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:241:26)
    at env.queueTask.once (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:215:56)
    at runLoop.add.once (file:///Users/mraible/dev/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:384:23)
    at Immediate.<anonymous> (/Users/mraible/dev/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
    at process.processImmediate (node:internal/timers:476:21)
JHipster Version(s)

The main branch

JHipster configuration

None. No .yo-rc.json written for any apps.

hide212131 commented 1 year ago

@mraible The error seems to be related to an incorrect jdl filename (perhaps it's not 'reactive-mf.jdl' but 'reactive-ms.jdl'). Isn't the error you actually want to address as follows?

$ jhipster jdl reactive-ms.jdl --monorepository --workspaces

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
                            https://www.jhipster.tech
Welcome to JHipster v8.0.0-beta.3

INFO! Generating jdls reactive-ms.jdl
ERROR! An error occured while running jhipster:jdl#parseJDL
ERROR! ERROR! Unknown value 'neo4j' for option 'devDatabaseType'.
Error: Unknown value 'neo4j' for option 'devDatabaseType'.
    at file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/models/jdl-application-configuration-factory.js:36:19
    at Array.forEach (<anonymous>)
    at createApplicationConfigurationFromObject (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/models/jdl-application-configuration-factory.js:29:38)
    at new JDLApplication (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/models/jdl-application.js:27:23)
    at createJDLApplication (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/models/jdl-application-factory.js:26:12)
    at file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/converters/parsed-jdl-to-jdl-object/application-converter.js:35:32
    at Array.map (<anonymous>)
    at convertApplications (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/converters/parsed-jdl-to-jdl-object/application-converter.js:33:31)
    at fillApplications (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.js:71:29)
    at Object.parseFromConfigurationObject (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.js:53:5)
    at getJDLObject (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/jdl-importer.js:127:42)
    at Object.import (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/jdl/jdl-importer.js:97:31)
    at JdlGenerator.parseJDL (file:///Users/hide/Documents/GitHub/generator-jhipster/dist/generators/jdl/generator.mjs:128:52)
    at JdlGenerator.executeTask (file:///Users/hide/Documents/GitHub/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:241:26)
    at env.queueTask.once (file:///Users/hide/Documents/GitHub/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:215:56)
    at runLoop.add.once (file:///Users/hide/Documents/GitHub/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:384:23)

Looking at the source, it seems that in v8 the option value checks have become stricter. By removing devDatabaseType and prodDatabaseType from neo4j and mongodb, the check passes.

    databaseType neo4j
#    devDatabaseType neo4j
#    prodDatabaseType neo4j

But, the next error occurs...

ERROR! An error occured while running jhipster:jdl#parseJDL
ERROR! ERROR! In the relationship between Blog and User, User is not declared. If 'User' is a built-in entity declare like 'Blog to User with builtInEntity'.
Error: In the relationship between Blog and User, User is not declared. If 'User' is a built