Expo Go crashes when using captureRef without logging anything

I have a View containing an image with another view overlaying it. I wish to use captureRef to save the image with the overlay, but when ever I try this Expo Go crashes without leaving any logs or error messages. Is there anything that could be causing this?

//I have a button that calls this. This is what crashes the app
const savePicture = async () => {
    const result = await captureRef(savedPicture, {
        result: 'tmpfile',
    })
}

// if photoData isn't undefined we render this
<View style={styles.container} ref={savedPicture}>
    <Image source={{ uri: photoData.uri }} style={styles.camera}/>
    <View style={styles.overlay}>
        <View style={styles.shape}/>
    </View>
</View>

What I’m trying to do is similar to this https://kyleclutter.medium.com/react-native-adding-overlay-date-stamp-to-photo-7c7299327004

Docs for captureRef: https://docs.expo.dev/versions/latest/sdk/captureRef/