One of our clients has a Salesforce chat on their site. It was working up until this past weekend, when Salesforce made some changes to their code.
I'm wondering if anyone else uses this and has run into the same problem
Here is the code (with client info omitted):
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1"></meta>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/1.0.10/purify.js"></script>
<script type="text/javascript" src="https://service.force.com/embeddedservice/5.0/esw.min.js"></script>
<style type="text/css"> .postChatButton { display:none; } .sidebarBody, .embeddedServiceSidebarFormField .slds-style-inputtext, .embeddedServiceSidebarFormField .slds-style-select, .sidebarHeader { font-family: "Arial" !important; } .message { border: none; background: none; color: white; font-size: 12px; font-family: arial; padding: 0px; } .embeddedServiceHelpButton .helpButton .uiButton { background-color: #005290; sans-serif; text-overflow: "unset"; max-width: 20em; } .embeddedServiceHelpButton .helpButton .uiButton:focus { outline: 1px solid #005290; } </style>
<script type='text/javascript'> var initESW = function(gslbBaseURL) { embedded_svc.settings.displayHelpButton = true; embedded_svc.settings.language = ''; embedded_svc.settings.enabledFeatures = ['LiveAgent']; embedded_svc.settings.entryFeature = 'LiveAgent'; embedded_svc.settings.defaultMinimizedText ='Chat with us'; embedded_svc.settings.disabledMinimizedText = 'Representatives Offline'; embedded_svc.init('https://client.my.salesforce.com', 'https://client-apprentice.secure.force.com/onlinechat', gslbBaseURL, '00D36000000rbye', 'Contact_Center_Snap_In', { baseLiveAgentContentURL: 'https://c.la4-c1-was.salesforceliveagent.com/content', deploymentId: '12345', buttonId: '12345', baseLiveAgentURL: 'https://d.la4-c1-was.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I360000004CAzEAM_16480cd8330', isOfflineSupportEnabled: true }); }; if (!window.embedded_svc) { var s = document.createElement('script'); s.setAttribute('src', 'https://client.my.salesforce.com/embeddedservice/5.0/esw.min.js'); s.onload = function() { initESW(null); }; document.body.appendChild(s); } else { initESW('https://service.force.com'); } </script>
This is producing a Error: Mismatched anonymous define() module
error in the console from default.js. I built a custom page that excludes default.js, and the chat works fine. Would love some advice on how to make this work