The Movie Database Support

I built a react app using this api which worked well on the local environment. But I get the this error "Failed to load resource: the server responded with a status of 404 ()" after build. WHat can I do?

2 replies (on page 1 of 1)

Jump to last post

@maryojo said:
404 error after build
I built a react app using this api which worked well on the local environment.
But I get the this error "Failed to load resource: the server responded with a status of 404 ()" after build.
WHat can I do?

See here: https://www.themoviedb.org/talk/62ab35641dcb77009fcb315c

I think this subject should be in API Support.
So I'm going to move this conversation to API Support.

Hi @maryojo I had a similar issue were the backdrop worked in local but when live, It kept failing to load the backdrop and just showing the** url image.tmdb.org/t/p/original/undefined and the console error Failed to load resource: the server responded with a status of 404 ()**

So what I did to fix this on my project was add this code to stop it grabbing the undefined URL

const displayBackdrop = movie !== undefined;

{displayBackdrop
        ? <img
          className='w-full h-full object-cover'
          src={`https://image.tmdb.org/t/p/original/${movie?.backdrop_path}`}
          alt={movie?.title}
        /> 
        : undefined
      }

Just thought I would add this so if it helps you with your problem then great and it not it could help someone else maybe down the line. It got rid of the error in the console and fixed the backdrop issue that I had.

Hope it helps and you get your problem sorted out

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login