evaluating Expo.FileSystem.cacheDirectory SDK 34

Hi all,
I have a problem on sdk 34,
i’m using “expo-file-system”: “~6.0.0”, and (import * as FileSystem from ‘expo-file-system’) in my project, when i start expo it not works and show error
undefined is not an object (evaluating Expo.Filesystem.cacheDirectory)

i wasn’t use Expo.Filesystem.cacheDirectory in project.
my package:
“expo”: “^34.0.3”,
“expo-file-system”: “~6.0.0”
“react”: “16.8.3”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz”,
and my app.json:
“sdkVersion”: “34.0.0”,

i had try to remove nodeModule + packaeg_lock and npm install

1 Like

Hi! Could you share a repro for this? Just tried it using a Snack in sdk 34 - https://snack.expo.io/@charliecruzan/filesystem.cachedirectory - and it worked, so I’m thinking something must be up with your installation

Hey! I got exactly the same problem after upgrading to SDK 34 :confused:

Hi, I am having the exact same problem, what did you do you fix the issue?

were you able to resolve the issue?

Hey ohope,

Unfortunately, I downgraded to the SDK 33… If someone has a solution, I’ll be grateful :slight_smile:

Hey everyone, can you confirm that it’s not working for you in the snack I linked above?

Make sure to read the FileSystem docs, namely you need to run expo install expo-file-system and import it with:

import * as FileSystem from 'expo-file-system';

1 Like

Hi Charlie,
in the snack that u linked above it works.

My problem is that app doesn’t start throwing this error ‘undefined is not an object (evaluating Expo.Filesystem.cacheDirectory)’ althoug i do not use Filesystem.chaceDirectory in my code.

in app.json i got “sdkVersion”: “34.0.0”,

And in package.json
“expo”: “^34.0.3”,
“expo-file-system”: “~6.0.0”,.

And i use :
mport * as FileSystem from ‘expo-file-system’;

I am using SDK 34.0.0;
and working for me.

import * as FileSystem from ‘expo-file-system’;


it will return cache directory address
More details on: https://docs.expo.io/versions/latest/sdk/filesystem/

1 Like

@pietro.falcetti Could you share a gh repo that reproduces this?

Ok, i catch the error.

The problem is that in my project i use the library ‘rn-pdf-reader-js’. This library uses an old version of expo, and import file system as :
‘import { FileSystem } from ‘expo’ instead of ’ import * as FileSysem’ from ‘expo-file-system’.

So i get the error 'cannot read property ‘cacheDirectory’ of undefined…


ah okay! Glad you found it

You’ll need to submit a PR to that repo to update their dependency/import statements to reflect these changes

1 Like

Hello all …

for me the fix was updating react-native-expo-image-cache from ^ 3.2.0 to ^ 4.0.4


Hey! I upgraded it too but now I have a new error :stuck_out_tongue:
“Cannot read property ‘propTypes’ of undefined” in createAnimatedComponent… grrr!

The author of the library already updated, and now everything works fine!

Thank u for the support :+1:


It’s okay for me too :slight_smile: That was react-native-svg-animated-linear-gradient which was facing a problem. I just had to upgrade it! thx

Glad everyone is getting it sorted out!

Yes i also have issuse. How do fix that??

It got this error after I upgraded to sdk 34
Cannot read property ‘propTypes’ of undefined -> createAnimatedComponent.js

The crash is happening here:

I’m not able to find where Image.js:142:34 is, though :confused:

Is your code calling createAnimatedComponent or something related to that? It seems that whatever is calling createAnimatedComponent is not passing in a valid component.