Hi, I have been stuck on Wanderlust steps 13, 14 for awhile…most recent error is a cors error. I’ve done some reading and understand a bit about what it is, but I am not sure how to resolve the issue so I can move on. The error:
Hi, I haven’t received a response to this issue I posted 10 days ago. I have done something incorrectly? Also, I included keys and I should not have. Can someone please edit the post and remove them?
It looks like you may have an issue with your clientId and/or clientSecret. I removed them for you from your post. Double check that they match exactly your credentials received when you created your foursquare account.
HI!!!
Thank you so much for the quick response. Unfortunately (or not) I double checked the id, and created a new client secret today. I also updated the id information for the weather api. None of the updates made any difference. It resulted in this cors error (see below). The only difference is that the first time around it directed me to Foursquare…this time it did not. I did some reading and learned a bit more about cors errors, unfortunately, the error “type” was not specified in dev. tools. Here is a screen shot that I took moments ago…hope it helps.
Thank you for removing the keys, live and learn…the hard was sometimes. LOL
I can’t really read the screenshot, but I ran your code, and found a problem.
If you delete the line mentioned by my comment, you should be able to proceed with the project, I believe. We don’t want to throw an error here. If we get a response, we log it to the console. If we don’t, the error will be caught in the catch statement. You could leave the line in your code, however, if you add an else statement, and put it inside its code block. That way the error will only be thrown if you don’t get a response. As is, it gets thrown every time the function is invoked.
I tried the next few steps with your code after removing the throw new Error('Request failed!'); statement, and everything seems to be working.
How do I get around this cors issue. I did some reading…in this case the cors does not have a type identified, so that didn’t help me figure it out either.
It looks like you are getting the same. This is what is expected at this point. I believe in the next step, you’ll convert the response to json, and start finding the parts you’ll want to extract.
Instead of cutting/pasting the url try right clicking on it, then click ‘Copy Link Location’, and paste it into a browser window. Should look like this:
Hi,
I’m not having any luck. I am using a MAC, and I don’t have the option of “Copy Link Location”, are tried everything that looked similar, no luck. Keeps taking me back to the same error, in which the “response” is empty (no data). I’ll try playing with it some more tomorrow and see if I can’t figure it out. I do understand about the conversion to json, but thus far, I can’t get to the data.
is not an error. The status: 200 means the request succeeded. This is the expected response. If you are unable to view it in a browser, I would just move on. I added these two lines to your code in the getVenues function inside the if(response.ok) block as per the instructions:
Hi Tod,
So you are saying that I’m getting hung up on the fact that I was unable to see it in the browser, correct? I recognized the 200 status (and so was even more confused)….Trying to understand why I feel so stupid! LOL. I’ll review (and add the code into the getVenues function as intended). Am I crazy?, or is this all a bit unclear (not placing blame for sure)?
I suppose, that’s basically it.
I don’t use Mac, so I can’t say why you are unable to successfully copy/paste the link into a browser, and see the response. Even with the raw data in a browser, you can find the venues. Anyhow, I wouldn’t stay hung up on it for long. You should be good to proceed with the project.
ncaught (in promise) TypeError: Cannot read property ‘main’ of undefined
at createWeatherHTML (helpers.js:13 )
at renderForecast (main.js:66 )
at main.js:76
Not sure why I am getting unauthorized on the first one. I decided to go back and repeat the last couple of modules, I feel like this was harder than it should have been. In the meantime, I’d like to get this step finished up. Any help is appreciated.
Hi Tod,
Thanks very much for the help. I would NEVER have figured out the ? Was missing. Oddly, I confident that I cut and pasted the url from the instructions because it was so long and I didn’t want to make a mistake. Somehow I must have deleted it.
Anyway, both errors cleared with that correction so I am all set. Again, your help was much appreciated. Is there something I should do to “close” the issue?