mindspank / qsocks

A lightweight promise wrapper around the Qlik Sense Engine API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

qsocks + node -> cannot redefine property: hasOwnPropertyCI

skokenes opened this issue · comments

Trying to run the qsocks node simple example with qsocks 3.0.5, getting the following error:

/Users/skokenes/Documents/Client/Axis Group/sensible/node_modules/qsocks/qsocks.js:25
Object.defineProperty(Object.prototype, "hasOwnPropertyCI", {
^

TypeError: Cannot redefine property: hasOwnPropertyCI

Any idea why I would get this error? This is running qsocks in Node, no other libraries or polyfills, etc being loaded

Just tried running on Node 6.0.0. Which version of node are you running?

Node v4.2.4

my bad, i was loading in another library that is messing this up. I will investigate further...

Would it make sense to check if Object has the hasOwnPropertyCI property before defining it?

ok now I feel really dumb - the reason I am getting this error is because I loaded my library first (which already bundled in qsocks), then loaded qsocks again. So it is running qsocks twice, thus trying to patch that property twice.

Still, does it make sense to check that it hasnt been added already before defining the property?