Archived
TypeError: Cannot redefine property: DoneListHelper
Hello,
Here is my node app:
app.js (require folder1/ice.js and folder2/ice.js)
folder1/
ice.js (require Common.js)
Common.ice
Common.js
folder2/
ice.js (require Common.js)
Common.ice
Common.js
Folder1 and Folder2 content is the same. When I start my node app.js requiring folder1/ice.js and folder2/ice.js, I have this error:
TypeError: Cannot redefine property: OrderListHelper
at Function.defineProperty (native)
at Object.Slice.defineSequence (/node_modules/ice/src/Ice/ArrayUtil.js:123:12)
at Common.js:524:11
Here is part of my Common.ice:
struct Order
{
string ordertype;
};
sequence<Order> OrderList;
and here is part of my Common.js:
Slice.defineSequence(CM, "OrderListHelper", "CM.Order", false);
If I comment out the Slice.defineSequence(CM, "OrderListHelper", "CM.Order", false); in one of the Common.js, then the error disappear.
Any idea on this one?
Many thanks for your help ![]()
Comments
-
Hi,
my JS app is connecting to different ICE server, each server using a different version of this Common.ice, so I generate different versions like:- Common.v1.js
- Common.v2.js
- Common.v3.js
And import them in different modules of my Node app. But as they are all redefining the same thing, there is an error. The define operation is probably global...is that voluntary design?
Many thanks!
0
