I am really stuck on this Film Finder project.
I have followed everything on Get Unstuck and on the MovieDB website itself…
The basic link below just pops up with a blank page.
I tried is with the “/” after the 3, but then it says API key invalid. I tried the Example API request and my key works perfectly.
I have tried to search the internet for an answer and I still cannot find anything.
Any help would be seriously appreciated.
Thank you so much:
The error I get on the console is:
I am not really sure if that would affect it and if yes, how exactly to update it to make it work
Because a cookie’s SameSite attribute was not set or is invalid, it defaults to SameSite=Lax, which prevents the cookie from being sent in a cross-site request. This behavior protects user data from accidentally leaking to third parties and cross-site request forgery.
Resolve this issue by updating the attributes of the cookie:
Specify SameSite=None and Secure if the cookie should be sent in cross-site requests. This enables third-party use.
Specify SameSite=Strict or SameSite=Lax if the cookie should not be sent in cross-site requests.
The catch block is within the try block. And you do not close the try block.
an else statement belongs where your catch clause is now. And you need to move the catch block one level up – after the closing curly brace of the try block, that you need to add.
I amended the coding as requested, I must’ve accidentally overlooked that.
Now the dropdown menu works, however if I choose a genre and click on the “Let’s play!” button, nothing happens.
Now when looking at the console, there aren’t any more errors.
Do you have any ideas what I else I might’ve missed, causing the button not to work?
In the showRandomMovie function, you call getRandomMovies.
But there is no such function defined in your code. That means there must be an error in the console. Are you looking at the google devtools?
Edit Just saw that there’s a file helpers.js with predefined functions that apparently do not need to be imported into script.js. But it does not contain a function getRandomMovies (check your spelling).
Don’t forget to remove your API key from your edited code.
You were right, it was supposed to be >getRandomMovie , so not Movies.
However, I keep getting this error:
Failed to load resource: net::ERR_CONNECTION_REFUSED
2script.js:43 Uncaught (in promise) ReferenceError: discoverMovieEndpoint is not defined
at getMovieInfo (script.js:43:39)
at HTMLButtonElement.showRandomMovie (script.js:65:20)
The button still does not work and won’t actually do anything besides the dropdown menu.
I have followed the getUnstuck video several times and I am about to give up.
Technically I have finished the project based on CodeAcademy… but it won’t work
Somehow magically the dropdown menu itself started working yesterday, I did not change anything on it.
But now, when I logged in to finish the project, the dropdown menu does not work anymore and the moviedb website still comes up blank
EDIT: the dropown menu now works, but it still keeps coming up with errors on console and “Let’s Play” button won’t work.