Using Gatsby and the app had been building successfully for many months. But starting from about 2 weeks ago the app no longer builds. It seems that Gatsby build completes successfully, but the build fails trying to move generated assets.
The exact error from the logs:
Cannot copy from public/1088-5db2239f0764d57a4137.js to /opt/build/cache/cwd/public/1088-5db2239f0764d57a4137.js: Cannot create directory /opt/build/cache/cwd/public: EACCES: permission denied, mkdir ‘/opt/build/cache’
Here is a link to the latest failed deployment attempt: https://dash.cloudflare.com/f1113781a43ee04ef4de7ff221496886/pages/view/appichiorg/806a81e1-8779-4380-83f4-a3500c9b8159
Initially we tried to upgrade Gatsby from 5.11 to 5.12, but rolled it back and tried both options - with the same problem.
A few packages that got really updated were: wagmi (from 1.3.8 to 1.4.1), viem (from 1.5.3 to 1.10.9) and @rainbow-me/rainbowkit (from 1.0.8 to 1.0.11)
I already tried using V2, the build failed there with different problem: /bin/sh: 1: gatsby: not found
That attempt is here: 95e0f95d-52a6-4dd3-8090-a9a3d0bab185
ID of a failed deployment with the primary/original problem is this: 806a81e1-8779-4380-83f4-a3500c9b8159