I'm trying to migrate jQuery Datatable from On Prem 2013 to online, I'm gonna create SPFX application extension, where I insert the scripts in order, still datatable is undefined.

$.fn.dataTable is undefined

I'm using jQuery 1.11.1 and DataTables 1.10.4.

Loading jquery and other files like below in config.json

 "externals": {
    "jquery": "https://xxx.sharepoint.com/SiteAssets/FileLookup/jquery-1.11.1.min.js",
    "datatables.net" : {
      "path": "https://xxx.sharepoint.com/SiteAssets/FileLookup/jquery.dataTables.min.js",
      "globalName": "jQuery",
      "globalDependencies": [
    "propertysearch": {
      "path": "https://xx.sharepoint.com/SiteAssets/FileLookup/filesearch.js",
      "globalName": "propertySearch",
      "globalDependencies": [

Shed me some ideas

1 Answer 1


Make sure you are using proper import statements & $ variable initialization like:

import 'jquery';
import 'datatables.net';
import 'moment';


var $: any = (window as any).$;

Follow this step by step guide which is exactly similar to your requirements: Migrate jQuery and DataTables solution built using Script Editor web part to SharePoint Framework

  • let me check this, the thing is I'm not trying to replicate existing code in SPFx, I'm trying to reference existing JS file scripted for data table implementation
    – Arun
    Commented Aug 17, 2021 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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