When I am adding script in Lightning Salesforce App. I have got this error given below

Error :

Content Security Policy: The page's settings blocked the loading of a resource at https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js ("script-src https://bappi--davidtest.lightning.force.com chrome-extension: 'unsafe-eval' 'unsafe-inline' ).

Please provide your suggestion.


1 Answer 1


Better option is download https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js this js file upload into static resource

and use ltng:require for load static resource. once static resource loaded acll your init function from afterScriptsLoaded

<ltng:require scripts="/resource/resourceName" afterScriptsLoaded="{!c.init}" />

This will solve your problem

  • I have already done. But I have got same error. Commented Dec 1, 2015 at 6:43
  • whats the error?
    – Ratan Paul
    Commented Dec 2, 2015 at 16:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .