PDA

View Full Version : Ext 6.5.0 Uncaught Error: Duplicate name



BCE
20 Dec 2017, 8:01 AM
Found bug in Ext.mixin.Container.attachNameRef
Here is such code:

if (!entry) { entry = component.shareableName ? [component] : component;
}
else if (!entry.isInstance) {
// Else an existing entry is either a component (which will have false
// for shareableName) or an array (all elements of which have true
// for their shareableName).
entry.push(component);
}
//<debug>
else {
Ext.raise('Duplicate name: "' + key + '" on ' +
me.id + ' between ' + entry.id + ' and ' + component.id);
}
//</debug>

And for me in several applications it Raises exception about Duplicate name, but entry and component is the same, so obviously it shouldn't cry.

To hide this exception for me worked to add:



if(entry !== component) {
Ext.raise('Duplicate name: "' + key + '" on ' +
me.id + ' between ' + entry.id + ' and ' + component.id);
}

tristan.lee
23 Dec 2017, 12:06 AM
Can you provide a test case on how this is reproduced?

BCE
23 Dec 2017, 12:54 PM
Unfortunately so far I can't reproduce it in fiddle (https://fiddle.sencha.com/#view/editor&fiddle/2bal), but maybe this will hint what can be wrong. I've reduced real code but tryed to keep everything that can cause the error. Stack trace is such:


log @ ext-modern-all-debug…=1514060762893:6367
raise @ ext-modern-all-debug…=1514060762893:2099
Ext.raise @ ext-modern-all-debug…=1514060762893:2130
attachNameRef @ ext-modern-all-debug…1514060762893:56609
_fixName @ ext-modern-all-debug…1514060762893:29526
fixReferences @ ext-modern-all-debug…1514060762893:18121
getReferences @ ext-modern-all-debug…1514060762893:56568
lookup @ ext-modern-all-debug…1514060762893:56574
lookup @ ext-modern-all-debug…1514060762893:62299
onChange @ TaskDialogController…dc=1514060762893:18
constructor @ TaskDialog.js?_dc=1514060762893:135
TaskDialog @ ext-modern-all-debug…=1514060762893:8888
widget

tristan.lee
23 Dec 2017, 1:16 PM
Is it reproducible every time in your app, just not fiddle? If you could show the actual error message you are receiving it probably leads to the cause.

BCE
23 Dec 2017, 11:31 PM
It's reproducible every time in real app (if remove my fix), stack trace is from real app, error is genereted by
Ext.raise('Duplicate name: "' + key + '" on ' +
me.id + ' between ' + entry.id + ' and ' + component.id); component names doesn't matter, it's always first field in the fieldpanel. I've encountered this error already in the second different application, checked, it's reproducible in both desktop and mobile modes.

tristan.lee
24 Dec 2017, 8:41 AM
I would continue to try to find a way to reproduce it in fiddle as the source code is there to raise the error if it occurs. Without a way to reproduce, it's hard to say if it's an app or framework issue.

BCE
24 Dec 2017, 12:44 PM
Thank you

r_honey
21 Apr 2019, 1:59 PM
I am facing similar issue with ExtJs 6.7.0. The following is the closest I could get, but still not able to reproduce in Fiddle:
https://fiddle.sencha.com/#view/editor&fiddle/2rmh

Locally in my app, clicking the button 3rd time reproduces the error on every subsequent click of the button (and yes, its on the first field in the form panel as observed above). In my case, I was using the grid editing plugin that slides in the form from the right. I noticed in the cleanup method, the form fields are removed as:

form.removeAll(false);

Which means the fields are not destroyed themselves. Switching it to true made the error go away for me. However the Fiddle still works with removeAll(false).