Sitelet https://github.com/lottie-react-native/lottie-react-native/pull/1467
Skip to content

fix: dotLottie detection matches '.lottie' substring anywhere in URI - #1467

Open
SGamrekelashvili wants to merge 1 commit into
lottie-react-native:masterfrom
SGamrekelashvili:fix/dotlottie-uri-detection
Open

SGamrekelashvili wants to merge 1 commit into
lottie-react-native:masterfrom
SGamrekelashvili:fix/dotlottie-uri-detection

Conversation

@SGamrekelashvili

Copy link
Copy Markdown

Bug: parsePossibleSources uses uri.includes('.lottie') to detect dotLottie archives. Any URL whose host contains .lottie — e.g. https://cdn.lottielab.com/l/xxx.json is misrouted to sourceDotLottieURI. Native then tries to unzip plain JSON as a dotLottie archive, fails silently, and nothing renders on iOS or Android.

Fix: check the actual file extension, ignoring query: uri.split(/[?#]/)[0].endsWith('.lottie').

Repro: <LottieView source={{ uri: 'https://cdn.lottielab.com/l/xxx.json }} autoPlay /> — blank view before, plays after.

Fixes #1331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix remote animations, that include .lottie in the file name and not the extension

1 participant