SharePoint Framework : error loading jquery in SharePoint

Copper Contributor



I have created a react/no js type of solution. When i try to import jquery into my solution this endup with issue loading the webpart (i cannot load the web part, and even i cannot navigate to the properties)

code as below:

After npm i jquery jqueryui --save and tsd install jquery jqueryui --save


import * as jQuery from 'jQuery';


at config file:

"jquery": {
"path": "",
"globalName": "jQuery"
"jqueryui": "node_modules/jqueryui/jquery-ui.min.js",


and then implort the 

import ModuleLoader from '@microsoft/sp-module-loader';


module load in the constructor:


During the gulp serve: it is always fails at "Starting subtask 'webpack'..."


With the above steps my webpart stoped working with the below issue:

[SPWebPartErrorCode.ScriptLoadError]:: Unable to load web part WebPart.NewsCarouselWpWebPart.ca083c3e-f91c-4ffa-88cb-4ae465ae8e76,Error: Error loading https://placeholder-base-url/df1a96d0-3809-4387-ad16-02d31aeb2570 script resources due to: undefined. CALLSTACK:: Error at t [as constructor] ( at new t ( at Function.t.create ( at


I can understand it is not rendering the external/cdn jquery related css files. 


can some one suggest what could have caused this issue?

I even tried with angular, it is not even loading the jquery dependent data for angular during the npm install angular --save command




2 Replies

Similar issue for me, this sample seems working fine, but when trying start new project, having issues with reference external libries.

it turns out using "require" would work, check this discussion.