I need to export my datatable to pdf, for that I'm using DataTables libraries.

It seems to be running fine here:

However while using the pdfmake.min.js file in lightning component, I'm getting below error. enter image description here

I'm not able to fix this error.

Here is my code: Component:

<aura:component >
<ltng:require scripts="/resource/jquery,

<table id="example" class="display" style="width:100%">
            <th>Start date</th>
            <td>Tiger Nixon</td>
            <td>System Architect</td>
            <td>Garrett Winters</td>


loadDataToCalendar :function(component,event,helper){ 

    $(document).ready(function() {

            dom: 'lBfrtip',
    buttons: [

        { extend: 'pdf'

        } );


  • looks like a locker service limitation you are hitting there.
    – glls
    Jul 18, 2018 at 18:36
  • 1
  • most likelt that the library is not supported with locker service
    – glls
    Jul 18, 2018 at 18:40
  • Based on the able link, I'm using latest version of the library and even reducing the lightning component to 39 version, I'm getting the error Jul 18, 2018 at 18:44
  • If library is not supported then is there any other option to fix the issue? Jul 18, 2018 at 18:45


You must log in to answer this question.

Browse other questions tagged .