jhipster / jdl-samples

Sample JDL files
Apache License 2.0
220 stars 214 forks source link

Gateway npm buil failed #28

Closed bendeguz-szatmari closed 4 years ago

bendeguz-szatmari commented 4 years ago

Hi,

I am using the microservice-ecommerce-store-istio-deployment.jdl example. The import-jdl succeeds, but webpack task fails:

Task :webpack

store@0.0.1-SNAPSHOT webpack:build D:_development\jdl-samples\store npm run cleanup && npm run webpack:build:main

store@0.0.1-SNAPSHOT cleanup D:_development\jdl-samples\store rimraf build/resources/main/static/

store@0.0.1-SNAPSHOT webpack:build:main D:_development\jdl-samples\store npm run webpack -- --config webpack/webpack.dev.js --env.stats=minimal

store@0.0.1-SNAPSHOT webpack D:_development\jdl-samples\store node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.dev.js" "--env.stats=minimal"

Webpack: Starting ... Webpack: Starting ...

 Compile modules  Build modules  Optimize modules  Emit files

Webpack: Finished after 48.974 seconds.

IDLE ERROR Failed to compile with 2 errors10:38:01 IDLE error in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts IDLE ERROR in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts(384,15): TS2304: Cannot find name 'Cheerio'. IDLE error in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts

ERROR in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts(732,69): TS2304: Cannot find name 'Cheerio'.

1133 modules

ERROR in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts ERROR in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts(384,15): TS2304: Cannot find name 'Cheerio'.

ERROR in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts ERROR in D:/_development/jdl-samples/store/node_modules/@types/enzyme/index.d.ts(732,69): TS2304: Cannot find name 'Cheerio'. npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! store@0.0.1-SNAPSHOT webpack: node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.dev.js" "--env.stats=minimal" npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the store@0.0.1-SNAPSHOT webpack 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\SzatmariBendeguz\AppData\Roaming\npm-cache_logs\2020-10-06T08_38_02_191Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! store@0.0.1-SNAPSHOT webpack:build:main: npm run webpack -- --config webpack/webpack.dev.js --env.stats=minimal npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the store@0.0.1-SNAPSHOT webpack:build:main 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\SzatmariBendeguz\AppData\Roaming\npm-cache_logs\2020-10-06T08_38_02_229Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! store@0.0.1-SNAPSHOT webpack:build: npm run cleanup && npm run webpack:build:main npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the store@0.0.1-SNAPSHOT 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\SzatmariBendeguz\AppData\Roaming\npm-cache_logs\2020-10-06T08_38_02_264Z-debug.log

JHipster info:

INFO! Executing jhipster:info Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
store@0.0.1-SNAPSHOT D:\_development\jdl-samples\store
`-- generator-jhipster@6.10.3
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "authenticationType": "jwt",
    "cacheProvider": "hazelcast",
    "clientFramework": "react",
    "serverPort": "8080",
    "serviceDiscoveryType": false,
    "skipUserManagement": false,
    "baseName": "store",
    "buildTool": "gradle",
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "jhiPrefix": "jhi",
    "languages": ["en", "fr"],
    "messageBroker": false,
    "nativeLanguage": "en",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "skipClient": false,
    "testFrameworks": ["protractor"],
    "websocket": false,
    "applicationType": "gateway",
    "packageName": "com.jhipster.demo.store",
    "packageFolder": "com/jhipster/demo/store",
    "useSass": true,
    "jhipsterVersion": "6.10.3",
    "creationTimestamp": 1601972880564,
    "skipServer": false,
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "embeddableLaunchScript": false,
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "blueprints": []
  },
  "entities": ["Customer", "Product", "ProductCategory", "ProductOrder", "OrderItem", "Invoice", "Shipment", "Notification"]
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
/**
 * Entities for Store Gateway
 */
entity Customer {
  firstName String required,
  lastName String required,
  gender Gender required,
  email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/),
  phone String required,
  addressLine1 String required,
  addressLine2 String,
  city String required,
  country String required
}
/**
 * Entities for product microservice
 */
entity Product {
  name String required,
  description String,
  price BigDecimal required min(0),
  size Size required,
  image ImageBlob
}
entity ProductCategory {
  name String required,
  description String
}
entity ProductOrder {
  placedDate Instant required,
  status OrderStatus required,
  code String required,
  invoiceId Long,
  customer String required
}
entity OrderItem {
  quantity Integer required min(0),
  totalPrice BigDecimal required min(0),
  status OrderItemStatus required
}
/**
 * Entities for Invoice microservice
 */
entity Invoice {
  code String required,
  date Instant required,
  details String,
  status InvoiceStatus required,
  paymentMethod PaymentMethod required,
  paymentDate Instant required,
  paymentAmount BigDecimal required
}
entity Shipment {
  trackingCode String,
  date Instant required,
  details String
}
/**
 * Entities for notification microservice
 */
entity Notification {
  date Instant required,
  details String,
  sentDate Instant required,
  format NotificationType required,
  userId Long required,
  productId Long required
}
enum Gender {
  MALE,
  FEMALE,
  OTHER
}
enum Size {
  S,
  M,
  L,
  XL,
  XXL
}
enum OrderStatus {
  COMPLETED,
  PENDING,
  CANCELLED
}
enum OrderItemStatus {
  AVAILABLE,
  OUT_OF_STOCK,
  BACK_ORDER
}
enum InvoiceStatus {
  PAID,
  ISSUED,
  CANCELLED
}
enum PaymentMethod {
  CREDIT_CARD,
  CASH_ON_DELIVERY,
  PAYPAL
}
enum NotificationType {
  EMAIL,
  SMS,
  PARCEL
}

relationship OneToOne {
  Customer{user(login) required} to User
}
relationship OneToMany {
  ProductCategory{product} to Product{productCategory(name)},
  ProductOrder{orderItem} to OrderItem{order(code) required},
  Invoice{shipment} to Shipment{invoice(code) required}
}
relationship ManyToOne {
  OrderItem{product(name) required} to Product
}

paginate Customer, Product, ProductOrder, OrderItem, Invoice, Shipment with pagination
service Customer, Product, ProductCategory, ProductOrder, OrderItem, Invoice, Shipment with serviceClass
microservice Product, ProductCategory, ProductOrder, OrderItem with product
microservice Invoice, Shipment with invoice
microservice Notification with notification

Environment and Tools

openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

git version 2.28.0.windows.1

node: v12.18.4

npm: 6.14.6

yarn: 1.21.1

Docker version 19.03.13, build 4484c46d9d

docker-compose version 1.27.4, build 40524192

identical .jhipster\Customer.json identical .jhipster\Invoice.json identical .jhipster\Notification.json identical .jhipster\OrderItem.json identical .jhipster\Product.json identical .jhipster\ProductCategory.json identical .jhipster\ProductOrder.json identical .jhipster\Shipment.json

Any suggestion on this? Switching to clientFramework angularX resolves the problem so I guess it is related to React, however I would like to use React.

Best Regards, Bendegúz

pascalgrimaud commented 4 years ago

@bendeguz-szatmari : have a look at https://github.com/jhipster/generator-jhipster/issues/12593

bendeguz-szatmari commented 4 years ago

Thanks, meanwhile I have found another solution which also works: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46006#issuecomment-699079290