I am building a lightning community based on Customer Service template and everything is working fine on Chrome. As part of cross browser testing, we ran it on Safari and started getting a weird issue on one of the pages.

Once the page is loaded, I am getting following error in the JS Console :

SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.

This JS is part of some safeEval.html. No additional details are provided in the browser.

When I tried to open the same page in the community builder (in Safari), it threw following error on page load:

This page has an error. You might just need to refresh it. Error in $A.getCallback() [undefined is not an object (evaluating 'fn.apply')] Callback failed: aura://ComponentController/ACTION$getComponent Failing descriptor: {markup://siteforce:routerInitializer}

Has anybody come across such issue? or any pointers. Let me know.

  • Looks like bug in the SFDC javascript code rather than anything to do with your components .Are you using const as a keyword ? Some browsers might not support them ? – Mohith Shrivastava Apr 28 '17 at 4:48
  • It's strange that this is only happening on one of the pages. Also It made me curious that what part of the page is causing the issue and why only safari? – Salesforcesmarty Apr 28 '17 at 5:55
  • Ya so looks like its salesforce code thats not been tested with specific version of safari you are using . – Mohith Shrivastava Apr 28 '17 at 6:13

I think Const is ecma6 but locker service is right now compliant with ecma 5 javascript standards

SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.

are you declaring variables with const keyword in your client side controller/helper code.

  • 1
    I am not declaring any of the variable as "const" in my code. – Salesforcesmarty Apr 28 '17 at 5:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.