jsrobertouimet
jsrobertouimet

Reputation: 103

React application working on desktop but showing a blank page on mobile

This issue has nothing to do with this post.

I built a full-stack application using create-react-app, Express, and MongoDB. As you can see, I successfully deployed it on Heroku (no errors in the log). The root ("/") page is supposed to be empty for now.

The problem arises when I try to access the application with my phone (iPhone 5s): I get this blank page, whether I am using Chrome, Firefox, or Safari:

Blank page on iPhone 5s

I should be able to see the navbar, even though the page has no content. A friend of mine uses an Android phone, and he got the same result.

It doesn't seem like there's a problem with the responsiveness since I can see the navbar with Chrome's developer tools:

enter image description here

Any idea?

Upvotes: 5

Views: 4011

Answers (3)

Isaac Borbon Miquirray
Isaac Borbon Miquirray

Reputation: 109

As jsrobertouimet explains this is caused by seeing your app with Redux Devtools.

In my case my Store was still with Devtools

    const store = createStore(
      rootReducer, 
      compose(applyMiddleware(thunk),
      window.__REDUX_DEVTOOLS_EXTENSION__ && 
      window.__REDUX_DEVTOOLS_EXTENSION__())
    );

To solve this I just deleted Redux Devtools extension code

    const store = createStore(
      rootReducer, 
      compose(applyMiddleware(thunk))
    );

Also delete the Redux Devtools extension in your browser to see as in your phone or any other device.

Upvotes: 0

Hashim Jameel
Hashim Jameel

Reputation: 21

I know this is an old question, but I'll post the answer in case anyone needs it.

The problem is in your server.js (Backend) file. You need to put the middlewares in server.js in the following order.

Screenshot to show the order of the middlewares

Upvotes: 1

jsrobertouimet
jsrobertouimet

Reputation: 103

I realized I was using Redux Devtools in production also. The error was caused by the fact that I was seeing the application with browsers that didn't have the extension installed.

Upvotes: 1

Related Questions