Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repetitive code in the entities.ts file after running the import command multiple times #21050

Closed
1 task
vw98075 opened this issue Feb 8, 2023 · 3 comments
Closed
1 task

Comments

@vw98075
Copy link
Contributor

vw98075 commented Feb 8, 2023

Overview of the issue

After reimporting the same JDl file with some changes, the entities.ts file contains repetitive code.

...
  {
      path: '/foo/:foo/view',
      name: 'Foo',
      component: FooDetails,
      meta: { authorities: [Authority.USER] },
    },
...

After running the import command three times in addition to the initial one, the section has four repetitive codes. To my memory, I reported this issue more than a year ago.

After running the tests with

./gradlew test

I get multiple errors with the same complaint:

     [vue-router] Duplicate named routes definition: { name: "foo", path: "/foo" }

      18 |
      19 | // prettier-ignore
    > 20 | const router = new Router({
         |                ^
      21 |   mode: 'history',
      22 |   routes: [
      23 |     {

I think the above is a result of the repetitive code.

Also, while walking through the yo-rc.json file, I notice the two languages are listed although I only select one language. And the app only shows one language too. Only one version of the messages.properties file though.

Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)

7.9.3

JHipster configuration
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "xyz",
    "blueprints": [],
    "buildTool": "gradle",
    "cacheProvider": "caffeine",
    "clientFramework": "vue",
    "clientPackageManager": "npm",
    "clientTheme": "spacelab",
    "clientThemeVariant": "light",
    "creationTimestamp": 1675473958704,
    "cypressAudit": true,
    "cypressCoverage": null,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": [
...
    ],
    "entitySuffix": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.9.3",
    "jwtSecretKey": ...
    "languages": ["en", "fr"],
    "lastLiquibaseTimestamp": 1675711058000,
    "messageBroker": false,
    "microfrontend": false,
    "microfrontends": [],
    "monorepository": true,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageName": "com.abc.xyz",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8080",
    "serverSideOptions": [],
    "serviceDiscoveryType": "no",
    "skipCheckLengthOfIdentifier": false,
    "skipClient": false,
    "skipCommitHook": true,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": ["cypress", "cucumber"],
    "websocket": false,
    "withAdminUi": true
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@vw98075 vw98075 changed the title Repetitive code in the entities.ts file Repetitive code in the entities.ts file after running the import command multiple times Feb 8, 2023
@vw98075
Copy link
Contributor Author

vw98075 commented Mar 1, 2023

These repetitive entries also are found in the entities.components.ts. When I run the app docker image build, I get the following error.

ERROR in ./src/main/webapp/app/entities/entities.component.ts:43:60
TS2300: Duplicate identifier '...'.

@github-actions
Copy link
Contributor

This issue is stale because it has been open for too long without any activity.
Due to the moving nature of jhipster generated application, bugs can become invalid.
If this issue still applies please comment otherwise it will be closed in 7 days

@mshima
Copy link
Member

mshima commented Jan 13, 2024

The reported problem is about jdl but the jdl with reproduction is missing.
Closing.

@mshima mshima closed this as completed Jan 13, 2024
@deepu105 deepu105 added this to the 8.2.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants