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

When generating entity code in JHipster, it's possible that certain imports, such as import MenuItem from 'app/shared/layout/menus/';, are inadvertently removed. #28855

Open
3 tasks
medoer opened this issue Mar 3, 2025 · 1 comment · May be fixed by #28866
Assignees
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: react $100 https://www.jhipster.tech/bug-bounties/

Comments

@medoer
Copy link

medoer commented Mar 3, 2025

Overview of the issue

When generating entity code in JHipster, it's possible that certain imports, such as import MenuItem from 'app/shared/layout/menus/';, are inadvertently removed.

import React from 'react';

const EntitiesMenu = () => {
return (
<>
{/* prettier-ignore /}



{/
jhipster-needle-add-entity-to-menu - JHipster will add entities to the menu here */}
</>
);
};

export default EntitiesMenu;

JHipster info

Welcome to JHipster v8.9.0

(node:8541) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
Welcome to the JHipster Information Sub-Generator

[email protected] /Users/bryce/codes/medo/jhipster-generators/jhipster-test-1
└── (empty)
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "jhipsterTest1",
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "react",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1741011753521,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "enableHibernateCache": null,
    "enableTranslation": true,
    "entities": [
      "Product"
    ],
    "feignClient": null,
    "jhipsterVersion": "8.9.0",
    "languages": [
      "en"
    ],
    "lastLiquibaseTimestamp": 1741011866000,
    "microfrontend": null,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageName": "com.mycompany.myapp",
    "prodDatabaseType": "mysql",
    "reactive": false,
    "serverPort": null,
    "serviceDiscoveryType": null,
    "syncUserWithIdp": null,
    "testFrameworks": [],
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "21.0.4" 2024-07-16
OpenJDK Runtime Environment Homebrew (build 21.0.4)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.4, mixed mode, sharing)

git version 2.46.0

node: v22.6.0
npm: 10.8.2

Docker version 25.0.3, build 4debf41

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
@ChangelogDate("20250303142426")
entity Product {
  name String required
  price BigDecimal required
  createdDate Instant
}

search Product with no

Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!

  • jhipster info output is mandatory for bug reports. This will allow us to use automated tests and genarate the broken sample using jhipster from-issue command.
Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)

v8.9.0

Browsers and Operating System
  • Tickets opened without reproduction steps or that doesn't follows the template recommendation will be closed.
  • Checking this box is mandatory (this is just to show you read everything)
@qmonmert
Copy link
Contributor

qmonmert commented Mar 4, 2025

@DanielFran I reproduce

@qmonmert qmonmert self-assigned this Mar 4, 2025
@DanielFran DanielFran added $100 https://www.jhipster.tech/bug-bounties/ $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ labels Mar 4, 2025
@qmonmert qmonmert linked a pull request Mar 4, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: react $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants