[Solved] Netlify error when exported from the cloud builder
[Solved] Netlify error when exported from the cloud builder
At a glance
The community member was having trouble deploying their project to Netlify. They tried using the self-hosted builder but encountered issues, so they switched to the cloud builder. However, they ran into errors when exporting the project as netlify-functions or netlify-edge-functions. They then tried the Vanilla template and were able to deploy using netlify deploy, but the site showed a "Page not found" error on the Netlify staging domain.
In the comments, another community member was able to rebuild the project into netlify-functions and deploy it to Netlify, but still encountered the same "Page not found" error. After some trial and error, the issue was resolved by explicitly pointing the deploy directory to build/client when running netlify deploy.
I couldn’t get the self-hosted builder to work properly and felt like there are too many moving parts that I need to debug, so I'm trying out the cloud builder now. Followed the docs and exported the project. Then tried deploying to Netlify. I exported as netlify-functions or netlify-edge-functions, it kept throwing an error at the end when running netlify build.
I switched to the Vanilla template and managed to deploy using netlify deploy, but now the site is showing "Page not found" on the Netlify staging domain. Not sure what I’m missing here. If I'm deploying on Netlify does it have to be only netlify functions or netlify edge functions? I will integrate a CMS so I need to export as a javascript application.
After a bunch of trial & errors this was resolved. When I ran netlify-deploy, it kept throwing The deploy directory "~/build/client" has not been found. Did you forget to run 'netlify build'? Then I explicitly pointed the directory netlify deploy --dir=build/client now it deploys perfectly and the page is now rendered.