Forum Discussion
Paul Chapman
Apr 05, 2018Iron Contributor
SPFX webpart - cannot call function in bundled library weather.js
 Hello, 
   
 I'm trying to get to grips with SPFX, specifically a basic webpart using weather.js () based on OpenWeatherMap.org. I wonder if anyone can help? Here is where I've got to... using Visual...
Steve Johnson
Apr 05, 2018Copper Contributor
I too am new to SPFx, but when I’ve had dependency files (JS, CSS), I’ve usually put them in the SRC folder, not the node_modules one. 
Not sure if that makes a difference?
Not sure if that makes a difference.
Not sure if that makes a difference?
Not sure if that makes a difference.
Paul Chapman
Apr 05, 2018Iron Contributor
Hi Steve,
Always nice to meet another noob (although I bet I am noober than you).
I don't know if your suggestion would make a difference really. The node_modules is just where the npm install command placed the library. As I say, I can already call 2 functions (setApi and getApi) ok so I don't think it's the issue. But you may be right. I'd still have the problem of 'how do I actually call .getCurrent?', with just a string? With a string and a function? Answers on a postcard...
Thanks for the suggestion, I may well give it a go, certainly in my next spfx project.