Closed anothergoodguy closed 1 year ago
I tried to make the changes locally and try running the generation, Getting one Warning
and One `Error``:
[@faker-js/faker]: faker.name is deprecated since v8.0 and will be removed in v10.0. Please use faker.person instead.
ERROR! An error occured while running jhipster:liquibase-changelogs#prepareFakeData
ERROR! ERROR! Invalid module method or definition: commerce.color
- faker.commerce.color is not a function
- faker.definitions.commerce.color is not an array
p [Error]: Invalid module method or definition: commerce.color
- faker.commerce.color is not a function
- faker.definitions.commerce.color is not an array
at _.fake (file:///home/jhipster/generator-jhipster/node_modules/@faker-js/faker/dist/esm/chunk-2JBE4HP3.mjs:11:7179)
at BootstrapApplicationBase.generateFakeDataForField (file:///home/jhipster/generator-jhipster/dist/generators/base-application/support/prepare-field.mjs:170:63)
at field.generateFakeData (file:///home/jhipster/generator-jhipster/dist/generators/base-application/support/prepare-field.mjs:310:45)
at file:///home/jhipster/generator-jhipster/dist/generators/liquibase-changelogs/generator.mjs:108:42
at Array.forEach (<anonymous>)
at DatabaseChangelogLiquibase.prepareFakeData (file:///home/jhipster/generator-jhipster/dist/generators/liquibase-changelogs/generator.mjs:91:28)
at DatabaseChangelogLiquibase.executeTask (file:///home/jhipster/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:240:26)
at env.queueTask.once (file:///home/jhipster/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:214:56)
at runLoop.add.once (file:///home/jhipster/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:383:23)
at Immediate.<anonymous> (/home/jhipster/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
at process.processImmediate (node:internal/timers:476:21)
commenting the below snippet is allowing to proceed further, but that might not be the ideal.
else if (columnName === 'color') {
fakeTemplate = 'commerce.color';
}
I mean the changes that are yet to be merged
could you please advise on --skip-fake-data
. not sure if it's considered during the initial steps or it's considered only during generation. It will be great if it can skip these validations also for running these experiments
still fails for color
Overview of the issue
Jhipster generation fails for)
at DatabaseChangelogLiquibase.prepareFakeData (file:///home/jhipster/generator-jhipster/dist/generators/liquibase-changelogs/generator.mjs:91:28)
at DatabaseChangelogLiquibase.executeTask (file:///home/jhipster/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:240:26)
at env.queueTask.once (file:///home/jhipster/generator-jhipster/node_modules/yeoman-generator/dist/actions/lifecycle.js:214:56)
at runLoop.add.once (file:///home/jhipster/generator-jhipster/node_modules/yeoman-environment/dist/environment-base.js:383:23)
at Immediate. (/home/jhipster/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
at process.processImmediate (node:internal/timers:476:21)
countryCode String maxlength(10)
inAddress
entity. Here is the error: [@faker-js/faker]: faker.address is deprecated since v8.0 and will be removed in v10.0. Please use faker.location instead. ERROR! An error occured while running jhipster:liquibase-changelogs#prepareFakeData ERROR! ERROR! The locale data for 'location.country_code' are missing in this locale. Please contribute the missing data to the project or use a locale/Faker instance that has these data. For more information see https://fakerjs.dev/guide/localization.html p [Error]: The locale data for 'location.country_code' are missing in this locale. Please contribute the missing data to the project or use a locale/Faker instance that has these data. For more information see https://fakerjs.dev/guide/localization.html at Object.get (file:///home/jhipster/generator-jhipster/node_modules/@faker-js/faker/dist/esm/chunk-2JBE4HP3.mjs:2:108) at H.countryCode (file:///home/jhipster/generator-jhipster/nodemodules/@faker-js/faker/dist/esm/chunk-2JBE4HP3.mjs:13:24833) at .fake (file:///home/jhipster/generator-jhipster/node_modules/@faker-js/faker/dist/esm/chunk-2JBE4HP3.mjs:13:117) at BootstrapApplicationBase.generateFakeDataForField (file:///home/jhipster/generator-jhipster/dist/generators/base-application/support/prepare-field.mjs:170:63) at field.generateFakeData (file:///home/jhipster/generator-jhipster/dist/generators/base-application/support/prepare-field.mjs:310:45) at file:///home/jhipster/generator-jhipster/dist/generators/liquibase-changelogs/generator.mjs:108:42 at Array.forEach (Motivation for or Use Case
Adding Country code to the Address.
Reproduce the error
Atached the JDL below and the issue is reproducible on
jhipster --with-entities --force --skip-install --skip-git --no-insight
also tried with
--skip-fake-data
but it doesn't have any effectRelated issues
22811
JHipster Version(s)
8.0.0-beta.2
JHipster configuration
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
git version 2.25.1
node: v18.16.1 npm: 9.5.1
'docker' command could not be found
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryAddress.json:
{ "applications": ["store"], "changelogDate": "20230707160053", "dto": "mapstruct", "entityTableName": "address", "fields": [ { "fieldName": "address1", "fieldType": "String" }, { "fieldName": "address2", "fieldType": "String" }, { "fieldName": "city", "fieldType": "String" }, { "fieldName": "postcode", "fieldType": "String", "fieldValidateRules": ["required", "maxlength"], "fieldValidateRulesMaxlength": "10" }, { "fieldName": "country", "fieldType": "String", "fieldValidateRules": ["required", "maxlength"], "fieldValidateRulesMaxlength": "2" }, { "fieldName": "contactNumber", "fieldType": "String", "fieldValidateRules": ["maxlength"], "fieldValidateRulesMaxlength": "45" }, { "fieldName": "mobileNumber", "fieldType": "String", "fieldValidateRules": ["maxlength"], "fieldValidateRulesMaxlength": "45" }, { "fieldName": "countryCode", "fieldType": "String", "fieldValidateRules": ["maxlength"], "fieldValidateRulesMaxlength": "10" } ], "name": "Address", "pagination": "infinite-scroll", "relationships": [ { "otherEntityName": "customer", "otherEntityRelationshipName": "address", "relationshipName": "customer", "relationshipSide": "right", "relationshipType": "many-to-one" } ], "searchEngine": "elasticsearch", "service": "serviceClass" }
Browsers and Operating System
Docker on MacOS : 13.4.1 (22F82)