Site is deployed but still showing blank page

My site is deployed but still showing blank page.

github-repo: GitHub - uditpadhan98/ecommerce

possibly because of this netlify issue

Hi @udit,

We’ve updated our status page (Netlify Status - Increase in errors in deployed sites) to Resolved. If you’re still having problems, please try re-deploying by going to the Deploy logs page, clicking on Trigger deploy and then selecting Clear cache and deploy site.

Please let us know if you continue to have issues.

@udit It’s because your assets aren’t loading:

Which is because of the paths:

You can see that particular file is actually here:

It’s happening as your build is configured to be hosted at /E-Commerce/, which you can see when you run npm run build:

As it says, you need to adjust the homepage declaration in your package.json:

still problem is not solve.

@udit Your original problem actually is solved.


What you’re seeing now is an entirely different problem.

If you check the console log in the developer tools of your browser you’ll find that your JavaScript is broken, so you should debug it.

Running your project locally with npm run start results in:

@udit Instead of making new threads, have you actually looked at or tried to debug your own project.

Follow the chain of how the application gets to where it errors, and you will find:

You’ll see that getLocalCartData calls localStorage.getItem("thapaCart"); and if it’s explicitly [] it returns [], otherwise it parses it as JSON.

If you debug what localCartData is, you’ll find that it’s null, because there is no localStorage item.

So you end up with initialState.cart === null.

The error that you’re seeing of Cannot read properties of null (reading 'reduce') is because in the file cartReducer.js at line 93 you have:

Since state.cart === null it does not have a reduce method.

You need to fix the initialization of the cart value.

1 Like