ENOENT: no such file or directory, open '/opt/build/repo/assets/favicon.png'

Hello everyone,

Since I upgraded the Expo SKD from version 45 to version 46, I can’t get a build. I have the following error code: Failed to compile CommandError: ENOENT: no such file or directory, open ‘/opt/build/repo/assets/favicon.png’
Yet the path does exist. And locally it works. Has anyone had the same problem, and if so, is there a solution?
Thank you for your answers.

Maybe relates to:

Hi hrishikesh,

Yes I have already checked this and there’s no case sensitivity trouble.

Thanks for the reply

Hi, @Louis_Syfer. The repo for the site in question is private so I’m not able to debug this directly. That being said, I see that the error is no long occurring and replaced by a different error.

The new error appears similar to the issue reported here:

There is a workaround for the new error in the issue linked to above. Would you please test the workaround mentioned in the issue above?

Hi @luke yes absolutely I discovered this report yesterday. This bug exists and I’m going to build with a previous version of @expo/dev-server.
Nothing to do with Netlify lol !

Thanks for your reply :ok_hand:

@luke Well I downgraded the version of expo dev-server and in local I have no error. However, the build is failing. I come back to the starting point with the same error message: ENOENT: no such file or directory, open ‘/opt/build/repo/assets/favicon.png’

Hi, @Louis_Syfer. Again, this error happens in the site’s build code. That is your code and our support team cannot see it.

One way to see if the file exists at the location would be to dump the contents of /opt/build/repo/ to the build logs if the error occurs.

This can be accomplished using some shell logic (the shell itself being bash). If you change the build command below:

npx expo export:web

to this:

npx expo export:web || { tree /opt/build/repo/assets/ ; false ; }

This will log the contents of that directory to the build log so you can see if the file exists or not.

The logic above says this:

  • run npx expo export:web
  • only if the command above exits with an error, then run tree /opt/build/repo/assets/
  • again, only if the npx expo export:web command exited with an error, also return an error (as false is a program that does just this)

If you make that change and see the file favicon.png in that directory please let us know because that would indicate some kind of bug. However, I believe you are more likely to discover that the file is indeed missing.

Either way, please feel free to reply here anytime.

Hello @luke

Thanks for your reply.

I tested your command and… it doesn’t work. However, it displays the tree structure within the console itself and we then realize that this famous favicon is not found during deployment even though it does exist… at the exact place where it must be found.

Then the console screenshot

But I was able to deploy using the Netlify CLI with my terminal

The site is published and updated normally. And it’s very fast !!

I can clearly see this being a case-sensitivity problem as explained before. In the console tree screenshot you’ve shared above, the extension is .PNG, and you’re requiring the file as .png.

Hi @hrishikesh

Thank you for your reply.
All extensions are lowercase, regardless of folder. I attach a screenshot of the root of my project. Please take a look.


Hi, @Louis_Syfer. You keep making incorrect statements. I realize you are not aware the statements are incorrect. However, you do have some facts completely wrong.

Please take a moment and consider what follows with an open mind. We really are telling you the reason for the error and the correct solution for it.

I tested your command and… it doesn’t work.

It did work. The entire purpose of the modified command was to dump the contents of the directory assets to the build log if the build failed. I explained that in detail when I suggested the change:

The build did fail.

The directory tree did get dumped to the build logs.

The build did not get published (which is good as we don’t want to publish builds with errors).

That was exactly the plan. The command worked perfectly. It got us the information we needed to debug this.

This is also incorrect:

The filenames look lower-case to you only because your computer’s filesystem is case insensitive. (MacOS and some types of Windows filesystems are case insensitive.) All of the popular Linux filesystems are case sensitive.

The sites build logs do prove that there are mixed-case files in the assets directory:

12:42:13 PM: $ npx expo export:web || { tree /opt/build/repo/assets/ ; false ; }
12:42:14 PM: Exporting with Webpack...
12:43:17 PM: Failed to compile
12:43:17 PM: CommandError: ENOENT: no such file or directory, open '/opt/build/repo/assets/favicon.png'
12:43:17 PM: /opt/build/repo/assets/
12:43:17 PM: ├── adaptive-icon.PNG
12:43:17 PM: ├── boostarz_splash.png
12:43:17 PM: ├── expo_logos
12:43:17 PM: │   ├── adaptive-icon.png
12:43:17 PM: │   ├── favicon.png
12:43:17 PM: │   ├── icon.png
12:43:17 PM: │   └── splash.png
12:43:17 PM: ├── favicon.PNG
12:43:17 PM: ├── fonts
12:43:17 PM: │   ├── Metropolis-Regular.otf
12:43:17 PM: │   └── Quicksand-Regular.ttf
12:43:17 PM: ├── icon.PNG
12:43:17 PM: ├── images
12:43:17 PM: │   ├── adaptive-icon.PNG
12:43:17 PM: │   ├── favicon.PNG
12:43:17 PM: │   └── icon.PNG
12:43:17 PM: └── splash.PNG
12:43:17 PM: 3 directories, 14 files

This shows three directories with favicon files. Those locations are (in the order listed above):


The only one using all lower case is /opt/build/repo/assets/expo_logos/favicon.png. That isn’t the error message, though. The error message is for for this file:


You don’t have that file. You have it with an upper-case file extension:


It is right there is the logs in plain text. The filename is absolutely and without any doubt a mixed case filename.

This is exactly the issue that @hrishikesh pointed out twelve days ago:

The build image filesystem is case-sensitive. The git repo is also case-sensitive. So, when the Linux build image clones the repo, the files are mixed case.

To summarize, we told you the correct answer twelve days ago. Please re-read that support guide above and, if there are still questions after reading it, let us know.

@luke @hrishikesh Alright!!
This part of my git directory was not updated since… April.
it works now.
Thank you for your support.