Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
Why does Nodemon is crushing after clicking on a button?

Javascript Code As you can see my button has a event handeler but when I click on the stock update button node nodemon crushed. I don't know why it's happening.

  const Inventory = ({ inventory }) => {
  const { name, img, _id, price, description, quantity,suplierName } = inventory; 
  const navigate = useNavigate();
  const navigateToInventories = id =>{
  navigate('/allinventory/' + id)
  }
  return (
        <div className='Row gx-5' style={{ width: '18rem',marginRight:'40px', 
           marginLeft:"40px" ,marginBottom:"40px"}} >
          <div className='Col-lg-3 '>
          <CardGroup className='ms-5 mt-3' style={{ width: '300px ', height:'560px'}}>
            <Card className='mt-4'>
              <Card.Img style={{ width: '300px' }} variant="top" src={img} />
              <Card.Body >
                <Card.Title>{name}</Card.Title>
                <Card.Text>
                  {description}
                </Card.Text>
                <Card.Text>
                 Price :{price}
                </Card.Text>
                <Card.Text>
                 Quantity : {quantity}
                </Card.Text>
                <Card.Text>
                 Suplier Name  : {suplierName}
                </Card.Text>
              </Card.Body>
              <Card.Footer>
                <Button onClick={() =>navigateToInventories(_id)} className='text-white, bg- 
                    dark'>Stock Update</Button>
              </Card.Footer>
            </Card>
          </CardGroup>
          </div>
        </div>
  );
};

export default Inventory;

Server side code By the following code I tried to fetch but in console it's say failed to fetch data.

 app.get('/inventory/:id', async (req, res) => {
            const id = req.params.id;
            const query = { _id: ObjectId(id) };
            const inventory = await inventoryCollection.findOne(query);
            res.send(inventory)
        });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!