Evaluating 'expo.default.fileSystem' error


im trying to run my app. but i keep getting this error. can anyone help me solve this problem.

What sdk version are you using?
Did you upgrade?
Make sure your imports are correct.

yes i did upgrade
my skd version is 36.0.0

which file i need to be in to change the imports., im lost to where which file in my app project that i need to change for this type of error ?

there many files hence why im asking

thanks :slight_smile:

In SDK 32 the import statement looked like this:

import { FileSystem } from 'expo';

In SDK 33 and later it now looks like this:

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

So you should look through all your files where you use FileSystem and make sure you’re using the correct import statement.

i did what you said but still gives the same error, is there anyway else i can fix this? this is for my university project.

if you can share your project we can help but without a full reproducible example we can’t do much. this site explains the problem well: http://idownvotedbecau.se/nocode/

here’s an example of expo-file-system being imported and used just fine, hope it helps: https://snack.expo.io/@notbrent/mature-pastry?platform=ios

https://drive.google.com/drive/folders/1xLbmJGLEyp-2K5xkEGh2ze386kSH7qxY?usp=sharing

this a link to project, that contains all the files

it’s very useful to create a mcve when asking for help too. i’ll look at the project but keep that in mind for the future. often you’ll solve your own problem by just doing that

actually it looks like you included the node_modules directory so it’s difficult for me to download this on my currently slow internet connection. could you try to create a mcve please?

also in AppWithStore you have this:

import {FileSystem} from 'expo-file-system'

notice the correct way to import this: https://docs.expo.io/versions/latest/sdk/filesystem/#api

i suspect the issue is with expo-three. i believe that the version you are currently using depended on FileSystem being imported from expo - you should try updating to version 5.3.0 - https://github.com/expo/expo-three/ - your project is currently on ^2.2.2-alpha.1

indeed that is the problem, here is the code that depends on FileSystem from that version of expo-three: https://github.com/expo/expo-three/blob/491cf63793e90672485e0d4be031ffff94e144d3/lib/readAsStringAsync/index.native.js

after updating expo-three to 5.3.0 it gave this error now

if you google that error you will find plenty of discussion around it, eg: https://github.com/facebook/react-native/issues/21490

you can delete node_modules, reinstall, and then run expo start -c and that will likely fix it. it seems to happen when node_modules / cache is in a bad state sometimes.

thanks for the i really appreciate it. but now i got this error, any ideas how to fix it ?

Hi.

In future can you please try copying/pasting the error in text form? This has a few advantages over the images:

  • It makes it easier for other users with the same problem to find when searching in the forums for the error message
  • It makes it easier for me to copy parts of the error message to search for solutions to the problems instead of having to retype things
  • The images are larger and therefore take more bandwidth and might have problems downloading when there are Internet undersea cable outages (like there are for me right now.)

You’ll notice there’s a Copy button at the bottom of the screen. It causes the error to be copied to the clipboard on your computer, so you can press the Copy button on the phone and then just Paste (Ctrl-V) into your comment on your computer. When you do that, make sure the error is marked as a code block so that it keeps the formatting. Like this:

```
error
here
```

Some general advice:

I see you have both package-json.lock and yarn.lock. This means you have at some point installed dependencies with npm and at another point installed dependencies with yarn. You should pick either npm or yarn for installing your dependencies. (This is separate from installing global npm packages like expo-cli. e.g. you can use npm install --global expo-cli to install expo-cli, while using yarn to install your app’s dependencies.) So choose whether you want to use npm install or yarn to install your dependencies, then remove the other lock file. You might want to remove node_modules and re-run your preferred command to re-install the dependencies at the same time.

When upgrading SDK version, upgrade one SDK version at a time. When you do that, read through the deprecations, breaking changes for the new SDK version and fix the issues. Then commit the changes to Git and test that the app still works as expected. Then repeat the process for the next SDK version. If you get weird errors about things not existing then read the documentation for the module/library you’re having problems with to see if you need to change the imports or something like that.

When upgrading Expo SDK versions you might also need to upgrade dependencies. The easiest way to do this is basically run expo install name-of-dependency for each dependency except for expo, react, react-native, react-dom or react-native-web, but you might want to upgrade one dependency at a time and test that the app still works or read the documentation for the new version of that dependency to see what’s changed. Also, commit the changes after each successful upgrade of a dependency so you can revert to a working app easily if something goes wrong while upgrading the next dependency.

This might seem like a lot of work, but it’s much easier to do one piece of the upgrade and fix the issues with it (Googling and asking questions about the things you get stuck on in the process) than to try an upgrade from Expo SDK 32 to SDK 36 in one go and get 100 errors to wade through where you each fix results in an app that’s still broken, but with a different error.

About this latest “store” error: This is something to do with redux which I’ve never used. Did this work before you started the upgrade? I don’t see where store is defined.

TypeError: store.getState is not a function. (In 'store.getState()', 'store.getState' is undefined)

This error is located at:
    in Connect(AppWithStore) (at App.js:17)
    in Provider (at App.js:16)
    in App (at withExpoRoot.js:26)
    in RootErrorBoundary (at withExpoRoot.js:25)
    in ExpoRoot (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in DevAppContainer (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

runComponentSelector
    C:\Users\abdullah\Urbscope\node_modules\react-redux\lib\components\connectAdvanced.js:42:10
initSelector
    C:\Users\abdullah\Urbscope\node_modules\react-redux\lib\components\connectAdvanced.js:194:24
Connect(AppWithStore)
    node_modules%5Cexpo%5CAppEntry.bundle?platform=ios&dev=true&minify=false&hot=false:143592:29
constructClassInstance
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:8251:26
updateClassComponent
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:12940:6
invokeGuardedCallbackImpl
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:307:15
invokeGuardedCallback
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:531:36
beginWork$$1
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:20488:8
performUnitOfWork
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:19370:24
workLoopSync
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:19347:39
renderRoot
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18997:22
runRootCallback
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18709:28
runWithPriority$argument_1
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5642:32
unstable_runWithPriority
    C:\Users\abdullah\Urbscope\node_modules\scheduler\cjs\scheduler.development.js:643:23
flushSyncCallbackQueueImpl
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5638:22
flushSyncCallbackQueue
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5627:28
scheduleUpdateOnFiber
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18556:30
scheduleRootUpdate
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:21822:15
ReactNativeRenderer.render
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:23042:20
renderApplication
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\ReactNative\renderApplication.js:52:52
runnables.appKey.run
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\ReactNative\AppRegistry.js:116:10
runApplication
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\ReactNative\AppRegistry.js:197:26
__callFunction
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:436:47
__guard$argument_0
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:111:26
__guard
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:384:10
__guard$argument_0
    C:\Users\abdullah\Urbscope\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:110:17

nope it did not work. before i upgraded.

undefined is not a function (near '...(0, _reactNavigation.TabNavigator)...')

<unknown>
    C:\Users\abdullah\Documents\scope\AppWithStore.js:27:26
loadModuleImplementation
    C:\Users\abdullah\Documents\scope\node_modules\metro\src\lib\polyfills\require.js:331:6
<unknown>
    C:\Users\abdullah\Documents\scope\App.js:3
loadModuleImplementation
    C:\Users\abdullah\Documents\scope\node_modules\metro\src\lib\polyfills\require.js:331:6
<unknown>
    C:\Users\abdullah\Documents\scope\node_modules\expo\AppEntry.js:4
loadModuleImplementation
    C:\Users\abdullah\Documents\scope\node_modules\metro\src\lib\polyfills\require.js:331:6
guardedLoadModule
    C:\Users\abdullah\Documents\scope\node_modules\metro\src\lib\polyfills\require.js:197:45
global code
    <unknown file>:0

now i have this error, ive tried looking online for solutions. but all did not work. any suggestions on how to deal with this error?