This forum has been archived. Please start a new discussion on GitHub.

TypeError: Cannot redefine property: DoneListHelper

edited September 2016 in Help Center


Here is my node app:

app.js (require folder1/ice.js and folder2/ice.js)
    ice.js (require Common.js)
    ice.js (require 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

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 :)


  • benoit
    benoit Rennes, France


    Why do you have two copies of the file and end up including the two generated Common.js file? You should instead only have one file and a Common.js file that you can include safely multiple times.


  • Hi,
    my JS app is connecting to different ICE server, each server using a different version of this, 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 that voluntary design?

    Many thanks!

  • xdm
    xdm La Coruña, Spain


    That is a limitation of our module system, modules are only defined the first time they appear and then the same module object is then reused, so you end up trying to redefine a property of a module when you include the generated code several times.