1

I have a VisualForce page with a script to dynamically display a lightning:clickToDial component. However, when the page is loaded I receive the following error message:

This page has an error. You might just need to refresh it. afterRender threw an error in 'lightning:clickToDial' [a.replace is not a function] Failing descriptor: {lightning:clickToDial}

Screenshot: enter image description here

VisualForce Page:

<apex:page>
<apex:includeLightning />
<script>
        $Lightning.use("c:ClickToDialApp", function() {
          $Lightning.createComponent("c:ClickToDial",
          { phone : 11231231234},
          "lightning",
          function(cmp) {
            // do some stuff
          });
        });
</script>

<div id="lightning" /> 
</apex:page>

Lightning Component:

<aura:component>
    <aura:attribute name="phone" type="Integer"/>
    TESTING: <lightning:clickToDial value="{!v.phone}"/>
</aura:component>

Lightning Dependency App:

<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="c:ClickToDial"/>
</aura:application>

Any information on what might be causing this error would be useful.

1

The Lightning component parameter value required quotes:

{ phone : "11231231234"}

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.