Issue with expo-asset after upgrading to SDK33

If I remove this chunk of code from expo-asset/build/Asset.js from node_modules, the app runs fine.

// Override React Native's asset resolution for `Image` components
setCustomSourceTransformer(resolver => {
    try {
        const asset = Asset.fromMetadata(resolver.asset);
        return resolver.fromSource(asset.downloaded ? asset.localUri : asset.uri);
    }
    catch (e) {
        return resolver.defaultAsset();
    }
});

Otherwise I get this exception

[Uncaught Error: undefined is not function (near '…(0,_resolveAssetSource2.setCustomTransformer))

Anyone else getting this issue?

That’s odd, I’m able to use Asset without any issues/changes to the source. Could you provide a Snack that reproduces the issue? (If this is a managed project, I’d make sure you run expo install expo-asset)

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.