Weather APP nothing displaying in console

So I’m working through a weather app but nothing seems to be running. I have the api’s setup but I’m getting blank when I open the console and am not getting any of the info I want. Any ideas on what it could be? I’m having the same issues over several apps. Here’s the current iteration https://codepen.io/MarcelPenn/pen/NoorLp?editors=1111

First, you have typo in long=position.coords.longitute; (it’s longitude).
Second, what should happen? You don’t log anything into console, you’re not doing any network requests.

Thanks for spotting the typo. Shouldn’t the api information be showing up in the console? The video I’m following keeps referencing it and showing all the weather statistics.

Hey, so I’ve done a bit more work and have a console log set up but am still getting nothing. Any idea why?https://codepen.io/MarcelPenn/pen/NoorLp?editors=1111

Template literals require backticks `.

Your api is a string :slight_smile:

const api = "${proxy}https://api.darksky.net/forecast/89d6c1af9813da32955fde3414fdddfe/${lat},${long}"

If you look into the browser’s console you’ll see the 404 network error :slight_smile:

Thanks! so it should look like this? const api = ‘${proxy}https://api.darksky.net/forecast/89d6c1af9813da32955fde3414fdddfe/${lat},${long}’; Also looked in the browser console rather than codepen, that’s what i was missing. Appreciate it!

Nope, that’s a single quote. You need a backtick.
According to your keyboard layout may be in different places.

Try searching for backtick [language] keyboard :slight_smile:


"I am a string with double quotes"
'I am a string with single quote'
`I am a template literal`


I’m an idiot lol. Thanks!

Any Idea why i’m getting all the errors?

Everything works for me, so I guess you’ve solved the problem?

well, ‘all the errors’ is a bit generic.

Maybe a demo, some code or a more precise question would help :wink:

1 Like

Sorry, I had a bunch earlier, I’m getting the data to the console now though and am only getting one error: index.html:54 GET https://codepen.io/boomerang/iFrameKey-732c5e48-1d40-0199-65b7-f25fc1a87031/style.css net::ERR_ABORTED 404

It’s working for me now as well minus one error lol, thanks!

Again, without a demo it’s nearly impossible to guess just by looking at a string.

My best guess is that somehow you are trying to load the css from within the pen, instead of using the style section provided.

Note that in codepen you don’t need to import any extrenal file in the head or through script tag like you would do in a normal webpage; instead you should add any external resource via the dropdown

Yeah, well thanks for the help and tips, I’ll try to figure out from here. Appreciate it!