Expo SDK36 RN 0.61.4中的获取以未定义形式返回

问题描述 投票:2回答:1

我最初使用此功能来调整大小,然后在较早版本的Expo中上载图像,并且效果很好:

uploadImage = async (originalUri) => {
    const { dispatchAvatar } = this.props;
    const { uri } = await reduceImageAsync(originalUri);

    const response = await fetch(uri);
    const blob = await response.blob();
    const photoData = { uri, blob };

    dispatchAvatar(photoData);
};

但是在Expo SDK 36(RN 0.61.4)中,当我尝试获取uri时,响应返回为未定义。 uri只是一个本地文件(file:///),如果查看response.headers,我可以看到“ content-type”:“ image / jpeg”,因此访存可以正确识别该文件。 >

[当我尝试记录响应时,我得到:

console.error: "There was a problem sending log messages to your development environment",
Error: value.hasOwnProperty is not a function. (In value.hasOwnProperty('tag')', 
'value.hasOwnProperty' is undefined).

关于升级到新版本的Expo和React Native的任何想法都会破坏这一点?在iOS设备或模拟器上不起作用。

我最初使用此功能来调整大小,然后在早期版本的Expo中上载图像,并且工作正常:uploadImage = async(originalUri)=> {const {dispatchAvatar} = this ....

javascript react-native expo react-native-ios
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.