10. Preparing for the front end for deployment (deployment)

Hi All,

Before deploying the application in heroku, while serving it locally , below is what I am getting, Do anyone knew about this .

its telling me there are somany movies, but there is no title mentioned,
so anybody knew this issue ???

In order to isolate the issue, I would suggest using the React Component tool in Chrome to look at the state of the Movies component and the props getting passed into the MoviesTable and make sure it’s what you expect.

1 Like

HI @rob ,

Thanks for your reply.

i have seen that already, and this is what i am getting in components.
dont know what went wrong. i have followed each step of mosh but still i get this error.

In the console, it looks like the array of movies is being logged. What do you see when you expand Array(3078)?

Do u want to see any of my code ??

I think this is your movies array. Instead of loading movies, you’re loading some sort of webpage response that starts with

<doctype html>...

I would re-look at your loading code. Perhaps you’re getting an error from the server or you have the wrong endpoint. There could also be an issue with your backend. Maybe looking at the rest of what’s loaded into this array will give you a clue as to what the source is.

correct.

when you say loading page, what do u mean by that, httpservice.jsx page ??

Look at where you’re loading the movie array, or whatever array is it that you’re logging here. Where do you populate it with movies? In my code, it’s in componentDidMount() in movies.jsx. Then you can track down the bug from there. The ultimate issue could be in movies.jsx, in httpservice, or somewhere else. My guess is that you’re either loading the wrong endpoint, or your node service isn’t working properly.

its working here fine, i have populated this two genre, but while going for production, its creating issue.

and also, that doc type is giving me “You need to enable JavaScript to run this app.”.
As i could see javascript is enabled in my chrome, that’s why i am able to finished till here.

So it works locally, but not on the server? What does the entire error message say? What do you see when you log the “You need to enable Javascript…” response? Does that response have a 400 error code?

I checked everything, but still not able to figure it out.
incase if you want to see my code then GitHub - kunalgo/vidlyReact.

Thank you for helping me still this point.

I think the most helpful thing to see would be if you logged the response you get in the getMovies() function:

export function getMovies() {
    const response = http.get(apiEndpoint)    
    console.log(response);
    return response;
}

@rob ,

its returning me the below promise, with that doctype data value

What’s the full content of request, headers, and the data string?

It looks like you’re calling the wrong URL. You’re making a call to http://localhost:5000/movies to get the movies. My guess is that your environment variable that contains the url isn’t getting loaded.