I'm using web3 version 1.8.0
it always shows this error "Uncaught TypeError: Cannot read properties of undefined (reading 'Contract')"
you have two import "web3". one is
import web3 from 'web3'
otherone is
// you are using Web3 in your contract
// this is overwriting
import Web3 from 'web3"
remove the first one