How do I deploy a create-react-app with netlify functions without errors?

Hello everyone! I’m new to deploying static websites in Netlify so I apologize for asking such silly question. I’m currently having problems in deploying create-react-app website here in Netlify and I can’t seem to find any solutions.

For overview, I am deploying a dictionary website where the user can search for words and the website will show definitions and other usages of the word. I am using a dictionary API to do such functions and I’m using an API key to access those functions.

Now for deployment, I used Netlify lambda functions to hide the API key to clients. I created a .toml file, install netlify on NPM, created functions to hide API key, and created an .env file. By the time I deployed the website, this error message shows:
Capture

Is there something that I didn’t take into consideration in performing the deployment steps? Like compiling the create-react-app first before deployment or any other things to perform? Thank you for your answers and I fully appreciate them.

Here is the link to my page: amazing-mcnulty-b0e8a3.netlify.app
Here is the github repository for that page: https://github.com/mmdalire/React-Dictionary

Hello @mmdalire! Welcome to the community :wave:

Netlify will build your site using the build commands you provide, then deploy the artifacts from the build using the directory that you indicate. Within that directory, Netlify is designed to serve index.html files by default. If you request a URL that doesn’t have an index.html page, that page is shown.

I took a quick peek at your netlify.toml file and don’t see any build-specific commands to run or build folders to deploy once the build is complete defined there. Those will need to be indicated either in your netlify.toml file, or via your site settings on app.netlify.com.

You can check out more troubleshooting steps in this post: [Support Guide] I’ve deployed my site but I still see "Page not found”, one of which is to try downloading the build results as indicated to see what was actually deployed. In your case, I’m skeptical to say that anything was even built in the first place, although I don’t know what your site settings are. Best of luck!

1 Like

Oh I see that I haven’t build my project yet before deploying. I may check those things for future deployment. However I just found the solution a while ago by following the steps in your article named ‘Deploy React Apps in less than 30 seconds’. Following those steps worked for me perfectly.

Thank you for replying to my concerns. I appreciate those solutions and I learned something new.

For the link for the article: https://www.netlify.com/blog/2016/07/22/deploy-react-apps-in-less-than-30-seconds/

1 Like