4

I'm currently working on a Lightning Component that needs a third party library when the library is loaded I get this error

Uncaught TypeError: r[o].hasOwnProperty is not a function
throws at /resource/1483607349000/CloudRebelTest__styleguidejs:3:5027 TypeError: r[o].hasOwnProperty is not a function
   at Function.t.widget.extend (CloudRebelTest__styleguidejs:3)
   at Function.t.widget.extend (CloudRebelTest__styleguidejs:3)
   at Function.t.widget.extend (CloudRebelTest__styleguidejs:3)
   at Function.t.widget.extend (CloudRebelTest__styleguidejs:3)
   at Function.t.widget (CloudRebelTest__styleguidejs:3)
   at CloudRebelTest__styleguidejs:7
   at CloudRebelTest__styleguidejs:3
   at Object.<anonymous> (CloudRebelTest__styleguidejs:3)
   at $globalEvalIIFE$ (CloudRebelTest__styleguidejs:30)
   at value (safeEval.html:78)
a @ aura_prod.js:723
(anonymous) @ aura_prod.js:723

Is there a way to work around it and to know why hasOwnProperty is not recognized as a function ?

  • Can you name the third party library you're using? Is it JavaScript strict mode compliant? – SE_User Jan 5 '17 at 11:43
  • It's a library used by a client so I can't name it unfortunately, it's minified and I don't have access to the full version. Is there big changes depending on the compliance to the strict mode ? – Nordine Hammache Jan 6 '17 at 11:06
  • Ok. And yes, Salesforce has introduced Locker Service. One of the basic requirements in it is that, the external JS libraries you're using should be JavaScript strict mode compliant. – SE_User Jan 6 '17 at 11:47
  • @SE_User even when the LockerService is disabled I get the same problem, as for the library it contains jQuery-UI and I think the problem is coming from it – Nordine Hammache Jan 11 '17 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.