Custom Gallery Block – Uncaught TypeError: setAttributes is not a function

Have you tried:

export default function Edit( { attributes, className, setAttributes } ) {

Edit is a react component, and react components receive props, so Edit( props ) is more accurate, hence the {} in the examples