ENOENT: no such file or directory, scandir error on loading app

I get the following error after upgrading expo version 31 to 33 in a detached project.

ENOENT: no such file or directory, scandir ‘/home/testuser/Documents/test-app/src/assets/fonts/node_modules/native-base/Fonts’

2 Likes

Hi @udithakasun, have you already looked through the release notes of each SDK (32 and 33)?

Shell-app.bundle contains these requested paths

Resolved the issue by upgrading native-base and @expo/vector-icons

1 Like

Updated my project, and trying to build again and have the same issue… I tried updating native-base & @expo/vector-icons to their latest but no luck. Any suggestions?

if you have imported following fonts add replace with following and be sure to import them in App.js

import FontAwesome from '@expo/vector-icons/fonts/FontAwesome.ttf';
import Ionicons from '@expo/vector-icons/fonts/Ionicons.ttf';
import Roboto from 'native-base/Fonts/Roboto.ttf';
import RobotoMedium from 'native-base/Fonts/Roboto_medium.ttf';

Use previous version vector icons if you can upgrade native base only if needed

Which native-base version did you update to?

2.3.1

After upgrading the sdk version from 32 to 33, I had a similar problem with Ant Design icons. Somehow the require path is not searching from node_modules/ anymore but from the current directory.

The only way I found to solve the issue is to change the path accordingly, in my case from @ant-design/icons-react-native/fonts/antoutline.ttf to ../../../node_modules/@ant-design/icons-react-native/fonts/antoutline.ttf, which is ugly but works.

1 Like

@remeus same s**t, bro. I was forced to change my path to font to ugly absolute paths.

Hey @sirmong and @remeus,

This was an open GH issue, but was closed since there were no reproducible examples shared (if you could provide one here, we can definitely open an issue for it)

The fix there was related to the file format, but it looks like you’re using .ttf already

How do you upgrade @expo/vector-icons ?

I re-installed @expo/vector-icons and it dit NOT fix the issue.
npm i @expo/vector-icons

THE ISSUE REMAINS
ENOENT: no such file or directory, scandir '/Users/.../node_modules/@expo/vector-icons/fonts' Failed building JavaScript bundle.

I’ve been at a complete stand still for over a month. I don’t know how anyone builds apps. Developing used to be SOOOO MUCH EASIER. You open a text editor, you write your code.

2 Likes

How and where do you make this change in path? That will fix the problem for all if you will be kind to share. Not sure why the fonts are being searched from project screen directory instead of where the fonts are actually located under node_modules. Thx

After upgrading vector-icons and native-base, make sure you have the new path for the import.

from:

import IoniconsFont from '@expo/vector-icons/fonts/Ionicons.ttf';

to:

import IoniconsFont from '@expo/vector-icons/website/src/fonts/Ionicons.ttf';

I couldn’t find the ‘fonts’ folder inside vector-icons, so a StackOverflow answer helped me:

I ended up having to use the following path for v10 of @expo/vector-icons:

@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/Ionicons.ttf
1 Like