Forum Discussion
James-Brennan
Aug 03, 2017Brass Contributor
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...
- 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
Wictor Wilen
Aug 03, 2017Iron Contributor
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
- James-BrennanAug 03, 2017Brass Contributor
Thanks Wictor, this resolved my build issue and I've learnt something new.
Cheers!
James.