bradtraversy / proshop_mern

Shopping cart built with MERN & Redux
1.99k stars 1.18k forks source link

Why does it not show in google chrome but it shows on safari. QTY selector. and problems with localstorage or [] #32

Closed talmax1124 closed 3 years ago

talmax1124 commented 3 years ago

This is in chrome. I have various issues. For one I have the issue from above. It does not display anything for chrome. Then it is not updating the [] in applications > local storage and is not showing on state > tree. Is there any fixes? I am in lecture 33 (Add to functionality).

Repository: github.com/talmax1124/cduoshop

or you can email me at carlitosdiazplaza@gmail.com

@basir @bradtraversy ?

bradtraversy commented 3 years ago

The qty selector happened to me at one point. I am pretty sure it is the Bootswatch theme. Try adding the standard Bootstrap CDN in your public/index.html file

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">

And comment out the bootswatch link in the index.js file. Let me know if you still can't see it

talmax1124 commented 3 years ago

The qty selector happened to me at one point. I am pretty sure it is the Bootswatch theme. Try adding the standard Bootstrap CDN in your public/index.html file

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">

And comment out the bootswatch link in the index.js file. Let me know if you still can't see it

I see the numbers now in the selector but in the console state > pin when I add an item to cart, it is not showing up in the tree. It stays blank. Also it is not showing in localstorage. I have watched the videos for about 5 times already.

Screen Shot 2020-10-19 at 4 40 39 PM

@bradtraversy @basir

bradtraversy commented 3 years ago

Can you link your repo or send your code/repo to support@traversymedia.com?

talmax1124 commented 3 years ago

Can you link your repo or send your code/repo to support@traversymedia.com?

I sent you an email with my email being carlitosdiazplaza@gmail.com

talmax1124 commented 3 years ago

@bradtraversy The repo is also in the top

bradtraversy commented 3 years ago

ok, two errors..

  1. In your cartScreen you are not getting the product id because you have

const productID = match.params.div

should be

const productID = match.params.id

  1. In your cart reducer in the else for if (existItem) you have the same thing happening as in the if. This should be
return {
          ...state,
          cartItems: [...state.cartItems, item],
        }

Check your code with the final repo

Please close any issues and q/a if this fixes it

talmax1124 commented 3 years ago

@bradtraversy Ok, yes now it shows in the state tree. How can I fix the the 3 errors in the console?

image

It only appears in Chrome. Do you know how to fix these errors?

bradtraversy commented 3 years ago

I am not sure why you are getting those errors, I did not get them when I ran your code. If you are still having issues, please post on Udemy q/a instead of github. This is not for student code issues, it is for bugs with the repo. Thanks :)