Problem with deploying my app in Netlify as i use the reducer function

I don’t know, although my app works fine in my local machine. when I deploy the in Netlify, the count stops working, so I saw in Console that handleClick works, yet the count always stays zero. only when you click very fast on the increment, you get 1 as the count. and again it becomes 0 for the next time. but this is not a problem if I use only one state for all characters, so just useState. what could be the prolem. thank you in advance for your answer.

import React, {  useReducer } from 'react'
const initState = {
    barbarian: 0,
    archer: 0,
    giant: 0,
    goblin: 0,
    wizard: 0
}
const actionTypes = {
    increment: 'increment',
    decrement: 'decrement'
}
function reducer(count, action) {
switch (action.type) {

    case actionTypes.increment:
        {
            return {
                ...count,
                [action.name]: count[action.name]++
            }
        }

    case actionTypes.decrement:
        {
            return {
                ...count,
                [action.name]: count[action.name] > 0 ? count[action.name]-- : 0
            }
        }
    default:

        return count
}

}


export default function Count({ name, id }) {


const [count, dispatch] = useReducer(reducer, initState)
function increment() {
    setTimeout(() => {
        dispatch({
            type: actionTypes.increment,
            id: id,
            name: name
        })
        console.log(count[name])
        console.log(name)

    }, 500)

}

function decrement() {
    setTimeout(() => {
        dispatch({
            type: actionTypes.decrement,
            id: id,
            name: name
        })
    }, 500)
}

return (
    <div className='counter'>
        <button onClick={decrement} className='bg-info'>-</button>
        <p className='count'>{count[name]}</p>
        <button onClick={increment} className='bg-success'>+</button>
    </div>
)
}
```Preformatted text

its my deploy:

What happens when you change this to:

count[action.name] + 1

Hi, it stil doesn’t work!

Where have you made this change? I don’t see it on your live site.

Are you sure? I changed the code in the count like you said and it developed on its own again. Can you show me with a screenshot how you saw that didn’t change?

I’m debugging your site by attaching breakpoints in Chrome thanks to the source maps you’re uploading:

It still show the old code.

i could not enter per command line the new commits. i have inserted the count file in git by drog and drop . however you did not notice any change. at next i tried to develop a new site but no success. do you know why i get the Error 404. when i want to develop my repo?

hi @Mostafa56

Are you talking about something different now? Are you no longer experiencing the counter increment issue?

Can you please share more details about the 404 you’re seeing now?

Thanks!