Random Snack Crashes

Hello, from a few days I’m facing an issue with Expo Snack and images. The app randomly crashes with the following error:

Device: /module:/src/assets/images/photosPortraitBrandon@2x.png: Unexpected token (1:93)

> 1 | https://snack-code-uploads.s3.us-west-1.amazonaws.com/~asset/5a5d13ad50d37eb46b8907acd5a2029f
    |                                                                                              ^
  Evaluating module://src/assets/images/photosPortraitBrandon@2x.png.js
  Evaluating module://src/assets/data/cards.js.js
  Evaluating module://src/screens/HomeScreen/HomeScreen.js.js
  Evaluating module://src/screens/index.js.js
  Evaluating module://src/navigation/AppNavigator.js.js
  Evaluating module://App.js.js
  Loading module://App.js

Although the image is available, there is a problem with displaying it. The strange thing is that the crashes happen randomly. It means that the app can work either 10 seconds or 1 minute without a crash, but in the end, a crash occurs.

Have anyone faced a similar issue?
Any workarounds for working with images using Snack?

Link to the Snack: github.com/netguru/sticky-parallax-header:examples/expo@BN-2452_Add_expo_example - Snack

Hey @maciejbudzinsking,

Could you please provide a minimal reproducible example of this? We appreciate you providing a snack but there is a lot going on there and without context and knowledge of your source code it’s going to be difficult to debug.


Hi @adamjnav, it seems that I’ve fixed the problem by moving my assets from root/src/assets to the root/assets directory.
Maybe I missed that requirement from the docs or this one is not documented. Can you elaborate on this more or just point the proper documentation page, please?

BTW. The Snack console displays the paths to the files with .js suffix. Is this expected behavior?

 Evaluating module://src/assets/images/photosPortraitBrandon@2x.png.js
 Evaluating module://src/assets/data/cards.js.js

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