Weather App - Skycons Bug [Solved]

So, I’m attempting to include Skycons into my weather app (using the Dark Sky API). It’s the last thing I need to add, but of course it’s giving me the most difficulty. After I create a new instance of Skycon, anything below it comes back blank. Here’s what I have:

//Skycons
var iconRequest = forecast.currently.icon;      
var icons = new Skycons();
var iconList = [
   "clear-day","clear-night","partly-cloudy-day","partly-cloudy-night",
   "cloudy", "rain", "sleet", "snow", "wind", "fog"];

console.log(iconRequest);

When I cal iconRequest, nothing shows up in the console, but if I call it before I create “icons”, it returns with what the DarkSky.currently.icon should return (“clear-night”, in this case). I’m not sure what I’m doing wrong here, honestly.

Here’s a link to the Pen: https://codepen.io/Actatus/pen/RVEvwb

1 Like

See the skycons docs. You need to add skycons.js first. Here’s a URL to the file you can add in the JS settings.
https://gitcdn.link/cdn/darkskyapp/skycons/master/skycons.js

2 Likes

Thanks, totally missed that. That’s what I get for not reading the docs close enough!