Home
Support Forums

404 Not Found when deploying from sub directory of GitHub repo

Hello.
I am following an Udemy tutorial and I can’t deploy a website from a subdirectory.
This is the github repo: GitHub - GeorgeFlorian/Udemy-React.Front.To.Back.2022
From there I want to deploy feedback-app.
These are the build settings:

I keep getting 404 Not Found at https://pensive-davinci-5dd5b7.netlify.app/

I’ve changed this around the Build Settings but I have no idea what I’m doing and that’s why I’ve posted here.

Hi @GeorgeFlorian

Welcome to the forums.

The base directory is correct, however the publish directory is not. As per common configurations React publish directory is build by default. Prepend to this the base directory and the publish directory is feedback-app/build.

@coelmay
I did as you said, but deployment won’t work.

Thank you for posting the screenshot. Text from the build log is preferred over screenshots though :slight_smile:

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

src/App.js
  Line 7:8:  'FeedbackData' is defined but never used  no-unused-vars
src/components/FeedbackStats.jsx
  Line 2:8:  'PropTypes' is defined but never used  no-unused-vars

In order to overcome this issue, you have two options:

  1. Remove the unused variables FeedbackData and PropTypes as you are not using them.
    Alternatively, use them.
  2. Change the build command to CI= npm run build which will set process.env.CI = false and ignore anything that is not an error (these are warnings.)

The latter is easier, the former will provide cleaner more efficient code.

1 Like

It finally worked.
Thank you.

1 Like