Forum Discussion

James-Brennan's avatar
James-Brennan
Brass Contributor
Aug 03, 2017
Solved

SPFX - jQuery causing build to fail

Hi,    I have an issue building a SPFX web part which I think is probably going to be caused by myself being a complete novice rather than any kind of bug etc.    When I create a new web part usi...
  • Wictor Wilen's avatar
    Aug 03, 2017

    When you're installing jQuery using npm (npm install jquery) you're installing the latest version of jQuery, same with @types/jquery. The latest version of jQuery does not work with SPFx (to be exact the TypeScript version used in SPFx). You need to install version 2 of jQuery:

    npm install jquery@2 @types/jquery@2 --save

Resources