Wanderlust:Syntax Error

Hi all,

when I do the Wanderslust Project at step 13 the console gives me an Uncaught Syntax Error Unexpected End of Input in line 65, a line I haven’t touched and was supplied by CodeCademy.

This is my code :
// Foursquare API Info

const clientId = ‘0VXBN1GZ51Q41MH2SOKGJZL3BRUSBDZRK4YUFRTOJZMJ4JZJ’;

const clientSecret = ‘5CLQIQK44YRXTSYRI0JYPS1SJUEWNGCY4NM33J3VII3OQYXU’;

const url = ‘https://api.foursquare.com/v2/venues/explore?near=’;

// OpenWeather Info

const openWeatherKey = ‘266ae8ae444f644f2ee2e2c883b57a8b’;

const weatherUrl = ‘https://api.openweathermap.org/data/2.5/weather’;

// Page Elements

const input = (’#city’);

const submit = (’#button’);

const destination = (’#destination’);

const container = (’.container’);

const venueDivs = [("#venue1"), ("#venue2"), ("#venue3"), $("#venue4")];

const weatherDiv = ("#weather1");

const weekDays = [‘Sunday’, ‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’];

// Add AJAX functions here:

const getVenues = async () => {

const city = $input.val();

const urlToFetch = ${url}${city}&limit=10&client_id=${clientId}&client_secret=${clientSecret}&v=20201129

try{

const response = await fetch(urlToFetch);

if(response.ok){

  console.log(response);

  const jsonResponse = await response.json();

  console.log(jsonResponse);

  const venues = jsonResponse.response.groups[0].items.map(item => item.venue);

  console.log(venues);

  return venues;

}

}catch(error){

console.log(error)

}

const getForecast = () => {

}

// Render functions

const renderVenues = (venues) => {

$venueDivs.forEach(($venue, index) => {

// Add your code here:

let venueContent = '';

$venue.append(venueContent);

});

destination.append(`<h2>{venues[0].location.city}`);

}

const renderForecast = (day) => {

// Add your code here:

let weatherContent = ‘’;

$weatherDiv.append(weatherContent);

}

const executeSearch = () => {

$venueDivs.forEach(venue => venue.empty());

$weatherDiv.empty();

$destination.empty();

$container.css(“visibility”, “visible”);

getVenues()

getForecast()

return false;

}

$submit.click(executeSearch)

Thank you for your time.

It looks like you are missing the backticks `` around the urlToFetch string

I’m having the same issue and I’m not missing the backticks

// Foursquare API Info
const clientId = '';
const clientSecret = '';
const url = 'https://api.foursquare.com/v2/venues/explore?near=';

// OpenWeather Info
const openWeatherKey = '';
const weatherUrl = 'https://api.openweathermap.org/data/2.5/weather';

// Page Elements
const $input = $('#city');
const $submit = $('#button');
const $destination = $('#destination');
const $container = $('.container');
const $venueDivs = [$("#venue1"), $("#venue2"), $("#venue3"), $("#venue4")];
const $weatherDiv = $("#weather1");
const weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

// Add AJAX functions here:
const getVenues = async () => {
const city = $input.val();
const urlToFetch = `${url}${city}&limit=10&client_id=${clientId}&client_secret=${clientSecret}&v=20210830`



try {
const response = await fetch(urlToFetch);
if (response.ok) {
  const jsonResponse = await response.json();
  const venues = jsonResponse.response.groups[0].items.map(item => item.venue);
  console.log(venues);
  return venues;
  //console.log(jsonResponse)
  } 
} catch (error) {
  console.log(error);
}

const getForecast = () => {

};


// Render functions
const renderVenues = (venues) => {
  $venueDivs.forEach(($venue, index) => {
    // Add your code here:

    let venueContent = '';
    $venue.append(venueContent);
  });
  $destination.append(`<h2>${venues[0].location.city}</h2>`);
}

const renderForecast = (day) => {
  // Add your code here:
  
	let weatherContent = '';
  $weatherDiv.append(weatherContent);
}

const executeSearch = () => {
  $venueDivs.forEach(venue => venue.empty());
  $weatherDiv.empty();
  $destination.empty();
  $container.css("visibility", "visible");
  getVenues()
  getForecast()
  return false;
}

$submit.click(executeSearch)

I think I removed the things I’m not meant to share like the API keys but only for this post.