Closed luisRubiera closed 5 years ago
Thanks, @luisRubiera for reporting the issue. Did you try with the latest JHipster version?
I was not able to reproduce the issue, either with 6.1.2 or 5.8.2 versions (I created a record for every entity and was able to edit each one).
Did you modify something in the code that could have led to this error ? Or if you have more specific details on the steps to reproduce (others than those already provided)
as we didn't manage to reproduce, I'm closing this ticket. Don't hesitate to try the last version and provide more steps to reproduce.
Bug is still present with "jhipsterVersion": "6.4.1" and react. Try this example:
entity Offer { name String required description String }
entity Category { name String required description String }
relationship ManyToOne {
Offer{user required} to User
Offer{category required} to Category
}
@gregu : plz, try the last version v6.6.0 and tell us if you can reproduce the issue. If it's the case, open a new ticket with all information
My initial jdl:
application {
config {
baseName example,
applicationType monolith,
packageName com.example,
authenticationType jwt,
prodDatabaseType mysql,
cacheProvider hazelcast,
buildTool gradle,
clientFramework react,
testFrameworks [protractor],
languages [en, pl],
nativeLanguage pl,
useSass true,
serverPort 8080
}
entities *
}
entity Offer {
name String required
description String
}
entity Category {
name String required
description String
}
relationship ManyToOne {
Offer{user required} to User
Offer{category required} to Category
}
From js console:
``
offer-update.tsx:110 Uncaught TypeError: Cannot read property 'id' of undefined
at OfferUpdate (offer-update.tsx:110)
at OfferUpdate (react-hot-loader.development.js:827)
at renderWithHooks (react-dom.development.js:16260)
at mountIndeterminateComponent (react-dom.development.js:18794)
at beginWork$1 (react-dom.development.js:20162)
at HTMLUnknownElement.callCallback (react-dom.development.js:336)
at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
at invokeGuardedCallback (react-dom.development.js:440)
at beginWork$$1 (react-dom.development.js:25780)
at performUnitOfWork (react-dom.development.js:24695)
OfferUpdate @ offer-update.tsx:110
OfferUpdate @ react-hot-loader.development.js:827
renderWithHooks @ react-dom.development.js:16260
mountIndeterminateComponent @ react-dom.development.js:18794
beginWork$1 @ react-dom.development.js:20162
callCallback @ react-dom.development.js:336
invokeGuardedCallbackDev @ react-dom.development.js:385
invokeGuardedCallback @ react-dom.development.js:440
beginWork$$1 @ react-dom.development.js:25780
performUnitOfWork @ react-dom.development.js:24695
workLoopSync @ react-dom.development.js:24671
performSyncWorkOnRoot @ react-dom.development.js:24270
(anonymous) @ react-dom.development.js:12199
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
flushSyncCallbackQueueImpl @ react-dom.development.js:12194
flushSyncCallbackQueue @ react-dom.development.js:12182
batchedUpdates$1 @ react-dom.development.js:24392
notify @ Subscription.js:23
notifyNestedSubs @ Subscription.js:65
handleChangeWrapper @ Subscription.js:70
dispatch @ redux.js:221
dispatch @ instrument.js:632
(anonymous) @ logger-middleware.ts:12
(anonymous) @ loading_bar_middleware.js:44
(anonymous) @ index.js:87
(anonymous) @ notification-middleware.ts:11
(anonymous) @ error-middleware.ts:16
(anonymous) @ index.js:11
dispatch @ redux.js:636
handleFulfill @ index.js:176
Promise.then (async)
(anonymous) @ index.js:196
(anonymous) @ notification-middleware.ts:19
(anonymous) @ error-middleware.ts:27
(anonymous) @ index.js:11
dispatch @ redux.js:636
(anonymous) @ authentication.ts:103
(anonymous) @ tslib.es6.js:73
__awaiter @ tslib.es6.js:69
(anonymous) @ authentication.ts:102
(anonymous) @ index.js:8
(anonymous) @ redux.js:475
(anonymous) @ app.tsx:31
commitHookEffectList @ react-dom.development.js:22030
commitPassiveHookEffects @ react-dom.development.js:22064
callCallback @ react-dom.development.js:336
invokeGuardedCallbackDev @ react-dom.development.js:385
invokeGuardedCallback @ react-dom.development.js:440
flushPassiveEffectsImpl @ react-dom.development.js:25392
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
flushPassiveEffects @ react-dom.development.js:25361
performSyncWorkOnRoot @ react-dom.development.js:24251
(anonymous) @ react-dom.development.js:12199
unstable_runWithPriority @ scheduler.development.js:697
runWithPriority$2 @ react-dom.development.js:12149
flushSyncCallbackQueueImpl @ react-dom.development.js:12194
flushSyncCallbackQueue @ react-dom.development.js:12182
unbatchedUpdates @ react-dom.development.js:24439
legacyRenderSubtreeIntoContainer @ react-dom.development.js:27527
render @ react-dom.development.js:27608
render @ index.tsx:29
./src/main/webapp/app/index.tsx @ index.tsx:42
__webpack_require__ @ bootstrap:790
fn @ bootstrap:150
1 @ jhipster_family_member_3.svg:1
__webpack_require__ @ bootstrap:790
checkDeferredModules @ bootstrap:45
(anonymous) @ bootstrap:930
(anonymous) @ bootstrap:930
Show 39 more frames
react-dom.development.js:21843 The above error occurred in the <OfferUpdate> component:
in OfferUpdate (created by ConnectFunction)
in ConnectFunction (created by Context.Consumer)
in ErrorBoundary (created by Context.Consumer)
in Route (created by ErrorBoundaryRoute)
in ErrorBoundaryRoute (created by Routes)
in Switch (created by Routes)
in Routes (created by Context.Consumer)
in ErrorBoundary (created by Context.Consumer)
in Route (created by ErrorBoundaryRoute)
in ErrorBoundaryRoute (created by Routes)
in Switch (created by Routes)
in div (created by Routes)
in Routes (created by Context.Consumer)
in ErrorBoundary (created by Context.Consumer)
in Route (created by PrivateRouteComponent)
in PrivateRouteComponent (created by Connect(PrivateRouteComponent))
in Connect(PrivateRouteComponent) (created by Routes)
in Switch (created by Routes)
in div (created by Routes)
in Routes (created by App)
in ErrorBoundary (created by App)
in div (created by Card)
in Card (created by App)
in div (created by App)
in div (created by App)
in Router (created by BrowserRouter)
in BrowserRouter (created by App)
in App (created by HotExportedApp)
in AppContainer (created by HotExportedApp)
in HotExportedApp (created by ConnectFunction)
in ConnectFunction
in div
in Provider
in ErrorBoundary
React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
``
I added code below to jdl and problem disappeared
dto * with mapstruct service * with serviceClass paginate * with pagination filter *
Now offer-update.tsx source code changed:
+ <AvInput id="offer-user" type="select" className="form-control" name="userId" required>
- <AvInput id="offer-user" type="select" className="form-control" name="user.id" value={isNew ? users[0] && users[0].id : offerEntity.user.id} required>
Overview of the issue
If i click on the "Edit" button of some entities i get the following error in the chrome console:
Motivation for or Use Case
this is a blocking problem that does not allow the edition of records in the app :( . at least there is a turn around by going to view and then clicking on edit
Reproduce the error
JHipster Version(s)
5.8.2
JHipster configuration
eyesr@0.0.0 /home/luis/Projects/eyesr/eyesr-webapp └── generator-jhipster@5.8.2
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System