App builds for Web browser, but not Android due to SVG (despite project not using SVG)

Hi,

My app builds and runs in the web browser, but the build fails for my Android mobile device. I’m not using or importing SVG anywhere in my project, and yet I get this error in the Metro Builder:

Unable to resolve “./elements/ForeignObject” from “node_modules\react-native-svg\src\ReactNativeSVG.ts”
Building JavaScript bundle: error

expo diagnostics:

Expo CLI 3.16.1 environment info:
System:
OS: Windows 10 10.0.18362
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.7 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5692245
npmPackages:
expo: ~36.0.0 => 36.0.2
react: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4

Fixed inexplicably with expo-cli update

there surely is an explanation for why, i could let you know if i had more info. i suspect the change may be related you having sourceExts or assetExts customized in app.json. then this commit would be related: Always include default extensions in sourceExts for Metro when starte… · expo/expo-cli@e640223 · GitHub - it prevents users from accidentally clobbering default extensions.

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