When using fetch to request data from The Movie DB I got stuck on this google inspect panel console error.
I don’t know what to do because I passed the API KEY correctly.
If anyone can help I would be grateful
exercise link below:
URL: https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-22-async-javascript-and-http-requests/modules/wdcp-22-learn-javascript-syntax-requests/projects/js-film-finder
const tmdbKey = ‘###’;
const tmdbBaseUrl = ‘https://api.themoviedb.org/3’;
const playBtn = document.getElementById(“playBtn”);
const getGenres = async () => {
const genreRequestEndpoint = “/genre/movie/list”;
const requestParams = “?api_key=tmdbKey”;
const urlToFetch = tmdbBaseUrl + genreRequestEndpoint + requestParams;
try {
const response = await fetch(urlToFetch , {cache: ‘no-cache’});
if (response.ok) {
const jsonResponse = await response.json();
console.log(jsonResponse);
}
} catch (Error) {
console.log(Error);
}
};