react-advanced-cropper JavaScript heap out of memory

Try to build after add react-advanced-cropper with the basic example.
get : FATAL ERROR: Reached heap limit Allocation failed – JavaScript heap out of memory

const GettingStartedExample = () => {
const [image, setImage] = useState(
  'https://images.unsplash.com/photo-1599140849279-1014532882fe?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1300&q=80',
);

const onChange = (cropper: CropperRef) => {
  console.log(cropper.getCoordinates(), cropper.getCanvas());
};

return (
  <Cropper
    src={image}
    onChange={onChange}
    className={'cropper'}
  >
)
};

wheni remplace with <></> is go to build, NODE_OPTIONS=–max-old-space-size=8192 has no effect.

any ideas

Leave a Comment