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.
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 !
@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’
Hopeless…
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.
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.
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, @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:
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:
/opt/build/repo/assets/favicon.png
You don’t have that file. You have it with an upper-case file extension:
/opt/build/repo/assets/favicon.PNG
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.