Using Editor with parcel and webpack bundlers

Using Editor with parcel and webpack bundlers

tablotablo Posts: 58Questions: 13Answers: 0

Hi all,

I'm trying to use the parcel bundler with Editor but I get no table and I see the following errors in the Chrome console when I visit http://localhost:1234/:

datatables.min.js:14 jQuery.Deferred exception: $.fn.dataTable.Editor is not a constructor TypeError: $.fn.dataTable.Editor is not a constructor
    at HTMLDocument.<anonymous> (http://localhost:1234/table.studentlist.46af4f5f.js:114:18)
    at l (https://cdn.datatables.net/v/dt/jq-3.3.1/moment-2.18.1/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.18/af-2.3.2/b-1.5.4/b-colvis-1.5.4/b-html5-1.5.4/b-print-1.5.4/cr-1.5.0/fc-3.2.5/fh-3.1.4/kt-2.5.0/r-2.2.2/rg-1.1.0/rr-1.2.4/sc-1.5.0/sl-1.2.6/datatables.min.js:14:29375)
    at c (https://cdn.datatables.net/v/dt/jq-3.3.1/moment-2.18.1/jszip-2.5.0/pdfmake-0.1.36/dt-1.10.18/af-2.3.2/b-1.5.4/b-colvis-1.5.4/b-html5-1.5.4/b-print-1.5.4/cr-1.5.0/fc-3.2.5/fh-3.1.4/kt-2.5.0/r-2.2.2/rg-1.1.0/rr-1.2.4/sc-1.5.0/sl-1.2.6/datatables.min.js:14:29677) undefined
w.Deferred.exceptionHook @ datatables.min.js:14

datatables.min.js:14 Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
    at HTMLDocument.<anonymous> (table.studentlist.js:10)
    at l (datatables.min.js:14)
    at c (datatables.min.js:14)

I've seen several related threads such as this one for parcel:
https://datatables.net/forums/discussion/53858/using-parcel-bundler-no-css-no-buttons-unknown-button-type-build-error-fs
and this issue on github:
https://github.com/parcel-bundler/parcel/issues/432

I've also found many more about webpack, some of them with solutions:
https://datatables.net/forums/discussion/45179/webpack-is-looking-for-an-index-in-the-datatables-folder

https://datatables.net/forums/discussion/53044/datatables-net-editor-bs4-webpack-installation-issues

https://stackoverflow.com/questions/36791472/jquery-plugin-datatables-with-webpack-and-typescript

I haven't tried with webpack yet but since I prefer parcel because of its simplicity I would like to ask what is the current state of the integration of both of them with Editor. Does parcel not work with Editor? Does webpack work with Editor? Could someone please enlighten me what are the problems, if there any?

I would also like to kindly ask the developers to provide guides for these integrations.

Answers

  • allanallan Posts: 63,089Questions: 1Answers: 10,388 Site admin

    You are right - I really do need to write up a simple guide. Have you installed Editor via npm / yarn as described here?

    Can you give a zip file of your project to I can take a look at to what is happening?

    Thanks,
    Allan

  • tablotablo Posts: 58Questions: 13Answers: 0

    Hi Allan,

    thanks for your response!
    Actually I haven't done much. I just created a test project with Generator and then tried to integrate parcel. No, didn't use npm or yarn to install the Editor. I'm not sure I've done it right since many things are new to me.

    Google has blocked my email because of the zip file. I put the file on my Google Drive and shared it with you.

    Thanks,
    Nick

  • allanallan Posts: 63,089Questions: 1Answers: 10,388 Site admin

    Thanks Nick. I'll get back to you shortly when I've had a chance to look into it.

    Allan

This discussion has been closed.