yuchen
yuchen

Reputation: 11

Why is my reactjs application showing a blank page when deployed with github pages?

My React-js app works fine when I use npm start to run it on localhost:3000.

However, when I deploy it, I can only see a blank page. There is also an error that is displayed:

Uncaught TypeError: Super expression must either be null or a function
    at index.js:974:1
    at index.js:973:1
    at Module.<anonymous> (index.js:972:1)
    at n (index.js:14:1)
    at e.exports (index.js:50:6)
    at Object.<anonymous> (index.js:4:1)
    at f ((index):1:1250)
    at 239 (Profile.jsx:188:28)
    at f ((index):1:1250)
    at 148 (login-page-pic.png:1:41)

Blank screen when deployed

I have run npm build and I have made sure that the branch settings are at "master", which is where the build files are.

There are no errors when I run npm build and when I run npm deploy.

My github repository for the whole application is here.

https://github.com/dawg420/friendzone-deploy

Upvotes: 1

Views: 406

Answers (1)

VonC
VonC

Reputation: 1328522

If you follow "ReactApp Deployment", it includes the command in the package.json:

  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -b main -d build",
                        ^^^^^^^

I would specify the branch option in order to not use the default branch master, but main.
(That is your issue: your site is currently generated in the master branch)

And I would double-check the publication source of your repository, to make sure it is "branch main, folder build".

Upvotes: 0

Related Questions