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

jhipster:entity:: while creating entities using import-jdl, got the ' Failed at the inventory@0.0.0 webpack:build script ' #6982

Closed devMaheshJava closed 6 years ago

devMaheshJava commented 6 years ago
Overview of the issue

[at-loader] Checking started in a separate process...

[at-loader] Checking finished with 15 errors 369ms asset optimization

. . .. .

ERROR in [at-loader] ./src/main/webapp/app/entities/device-movement/device-movement-dialog.component.ts:12:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-request/index"' has no exported member 'DeviceRequest'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-movement/device-movement-dialog.component.ts:12:25 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-request/index"' has no exported member 'DeviceRequestService'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-property/device-property-dialog.component.ts:13:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type-property/index"' has no exported member 'DeviceTypeProperty'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-property/device-property-dialog.component.ts:13:30 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type-property/index"' has no exported member 'DeviceTypePropertyService'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-request-conversation/device-request-conversation-dialog.component.ts:12:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-request/index"' has no exported member 'DeviceRequest'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-request-conversation/device-request-conversation-dialog.component.ts:12:25 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-request/index"' has no exported member 'DeviceRequestService'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-type-property/device-type-property-dialog.component.ts:12:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type/index"' has no exported member 'DeviceType'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device-type-property/device-type-property-dialog.component.ts:12:22 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type/index"' has no exported member 'DeviceTypeService'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device/device-dialog.component.ts:13:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type/index"' has no exported member 'DeviceType'.

ERROR in [at-loader] ./src/main/webapp/app/entities/device/device-dialog.component.ts:13:22 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type/index"' has no exported member 'DeviceTypeService'.

ERROR in [at-loader] ./src/test/javascript/spec/app/entities/device-movement/device-movement-dialog.component.spec.ts:11:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-request/index"' has no exported member 'DeviceRequestService'.

ERROR in [at-loader] ./src/test/javascript/spec/app/entities/device-property/device-property-dialog.component.spec.ts:12:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type-property/index"' has no exported member 'DeviceTypePropertyService'.

ERROR in [at-loader] ./src/test/javascript/spec/app/entities/device-request-conversation/device-request-conversation-dialog.component.spec.ts:11:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-request/index"' has no exported member 'DeviceRequestService'.

ERROR in [at-loader] ./src/test/javascript/spec/app/entities/device-type-property/device-type-property-dialog.component.spec.ts:11:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type/index"' has no exported member 'DeviceTypeService'.

ERROR in [at-loader] ./src/test/javascript/spec/app/entities/device/device-dialog.component.spec.ts:12:10 TS2305: Module '"D:/inventory-ms/apps/inventory/src/main/webapp/app/entities/device-type/index"' has no exported member 'DeviceTypeService'. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! inventory@0.0.0 webpack:build: yarn run cleanup && yarn run webpack:build:main npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the inventory@0.0.0 webpack:build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\BILONE\AppData\Roaming\npm-cache_logs\2018-01-13T12_31_05_232Z-debug.log

Motivation for or Use Case : To create the entities
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
Environment and Tools

java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

git version 2.15.1.windows.2

node: v8.9.3

npm: 5.6.0

bower: 1.8.2

gulp: [18:35:29] CLI version 3.9.1

yeoman: 2.0.0

yarn: 1.3.2

Docker version 17.12.0-ce, build c97c6d6

docker-compose version 1.18.0, build 8dd22a96

JHipster configuration
JHipster Version(s)
inventory@0.0.0 D:\inventory-ms\apps\inventory
`-- generator-jhipster@4.13.3
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.bil",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "4.13.3",
    "baseName": "inventory",
    "packageName": "com.bil",
    "packageFolder": "com/bil",
    "serverPort": "8080",
    "authenticationType": "session",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "rememberMeKey": "replaced-by-jhipster-info",
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "npm",
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling",
      "cucumber",
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "tr"
    ]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Device_Service_Actual (device_service_actual) {
  device Long required,
  company Long required,
  personname String required,
  personemail String required,
  persontel String required,
  startdate LocalDate required,
  enddate LocalDate required,
  nextdate LocalDate required,
  servicedate LocalDate required,
  problem AnyBlob required,
  duration Float required,
  routine Integer required,
  warranty Integer required,
  invoiceno String required,
  amount Float required,
  done Boolean required,
  explanation AnyBlob required,
  docid AnyBlob required,
  docname String required,
  docmimetype String required,
  length Long required,
  userwarned Boolean required,
  warningdate LocalDate required
}
entity Device (device) {
  uuid String required,
  manufacturerid BigDecimal required,
  companyid BigDecimal required,
  model String required,
  purchasedate LocalDate required,
  installdate LocalDate required,
  serviceperiod Long required,
  calibrationperiod Long required,
  inventoryno String required,
  guaranteeterm LocalDate required,
  firstcalibrationdate LocalDate required,
  coordinator BigDecimal required,
  department Long required,
  unassisted Integer required,
  assistent BigDecimal required,
  training Integer required,
  trainer Long required,
  externalusage Integer required,
  status Integer required,
  type Long required,
  availability Integer required
}
entity Device_Request_Conversation (device_request_conversation) {
  requestid Long required,
  conversationid Long required
}
entity Conversation (conversation) {
  uuid String required,
  body AnyBlob required,
  createdby Long required,
  createddate LocalDate required,
  updateddate LocalDate required,
  seqno Long required,
  isprivate Boolean required
}
entity Conversation_Mentions (conversation_mentions) {
  uuid String required,
  conversationid Long required,
  mention Long required
}
entity Device_Request (device_request) {
  uuid String required,
  requestedby Long required,
  explanation AnyBlob,
  requesteddate LocalDate required,
  approvedby Long required,
  approvalstatus String required,
  approveddate LocalDate required,
  grantedby Long required,
  grantstatus String required,
  granteddate LocalDate required,
  fromdate LocalDate required,
  todate LocalDate required,
  approvercomments String,
  grantedcomments String
}
entity Device_Movement (device_movement) {
  requestid Long required,
  device Long required,
  givenby Long required,
  receivedby Long required,
  receiveddate LocalDate required,
  duedate LocalDate required,
  actualsubmitdate LocalDate required,
  grantingcomments AnyBlob required,
  receivecomments AnyBlob required,
  fineamount Float required,
  status String required,
  docid AnyBlob required,
  docmimetype String required,
  doclength Long required
}
entity Department (department) {
  name String required
}
entity Coordinator (coordinator) {
  name String required,
  branch String required,
  director Long required,
  originaldirector Long required
}
entity Person (person) {
  uuid String required,
  uname String required,
  firstname String required,
  lastname String required,
  isactive Boolean required
}
entity Manufacturer (manufacturer) {
  uuid String required,
  name String required
}
entity Company (company) {
  uuid String required,
  name String required
}
entity Device_Type (device_type) {
  uuid String required,
  name String required,
  isactive Boolean required,
  createdat LocalDate required,
  updatedat LocalDate required
}
entity Device_Type_Property (device_type_property) {
  uuid String required,
  name String required,
  typeid Long required,
  displayname String required,
  createrat LocalDate required,
  updatedat LocalDate required,
  isactive Boolean required
}
entity Device_Property (device_property) {
  device Long required,
  property Long required,
  value String required
}

relationship OneToMany {
  Person{device} to Device{assistent},
  Person{device} to Device{trainer},
  Person{coordinator} to Coordinator{director}
}
relationship ManyToOne {
  Device_Service_Actual{device} to Device,
  Device_Service_Actual{company} to Company,
  Device{companyid} to Company,
  Device{manufacturerid} to Manufacturer,
  Device_Request_Conversation{conversationid} to Conversation,
  Conversation{createdby} to Person,
  Conversation_Mentions{mention} to Person,
  Device_Movement{device} to Device,
  Device_Movement{receivedby} to Person,
  Device_Movement{givenby} to Person,
  Coordinator{originaldirector} to Person,
  Device_Property{device} to Device
}

dto Device_Service_Actual, Device, Device_Request_Conversation, Conversation, Conversation_Mentions, Device_Request, Device_Movement, Department, Coordinator, Person, Manufacturer, Company, Device_Type, Device_Type_Property, Device_Property with mapstruct
paginate Device_Service_Actual, Device, Device_Request_Conversation, Conversation_Mentions, Device_Request, Device_Movement, Department, Coordinator, Person, Manufacturer, Company, Device_Type, Device_Type_Property, Device_Property with pagination
service Device_Service_Actual, Device, Device_Request_Conversation, Conversation, Conversation_Mentions, Device_Request, Device_Movement, Department, Coordinator, Person, Manufacturer, Company, Device_Type, Device_Type_Property, Device_Property with serviceImpl
paginate Conversation with infinite-scroll

Browsers and Operating System
gmarziou commented 6 years ago

I can't reproduce the errors using JHipster 4.13.3, see https://github.com/gmarziou/jh-6982

I only got lint warnings because you named your entities with underscores.

gmarziou commented 6 years ago

Is it the first JDL import you did or did you make several iterations? My hypothesis is that you did not delete previously generated files.

So I'm closing it as it seems to be an issue on your side.

devMaheshJava commented 6 years ago

Yeah, it's my first jdl import to this project. At first time only I got this error and I don't know what I did wrong.So I rolled back to previous HEAD version and I again tried.But this time also got same issue.

gmarziou commented 6 years ago

Well try the project I shared and build it, if it works compare with yours. Rolling back to HEAD does not mean that obsolete files are removed, especially if you renamed some entities.

Difference between you and I is that I started from empty directory, copied your .yo-rc.json run jhipster then jhipster import-jdl entities.jh, so I'm sure my project is clean while I'm not sure for yours.

By the way, I'd recommend that you stick with our naming conventions for entities: use camel case and not snake case as it can only bring trouble. So rename Device_Service_Actual to DeviceServiceActual