How to handle large JSON files?

#1

Hi,
I am new to Expo, and I have a 5MB JSON file that I want to load in my app.
However, the “Building JavaScript bundle” is stuck at 99% (trying to build for Android with the Expo app and CRNA “npm start”).
If I simply reduce the file to be smaller, it works well.
so my question is how should I handle large JSON files with the expo app?
I’m OK to consider my JSON file as an asset, so it will be downloaded the first time and then cached, but I don’t think JSON files are considered as assets?
Otherwise how can I do, considering that I would prefer not having any backend as my app is really basic (and the 5MB file will be the only “large” file to bundle).

Thanks

#2

Hi,
I am still stuck with this issue :confused:
For information, I am simply importing my JSON file like this:

import data from './data'

I have tried using const data = require('./data') but it does not change anything

closed #3

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