Home
Support Forums

Can't deploy frontend alone, with frontend and backend in the same folder

Hi, I have my frontend and backend in the same folder, but want to host them separately, with the frontend on netlify, I put /client in the build, so it goes into the client folder to build, but deployment has been failing. This is the site name unruffled-euclid-43cc20.netlify.app

Hi @dimola7

Are you able to share the text of, or link to, your deploy log. It difficult to see what is happening when only part of the log is visible via a screenshot.

It would also help if you could share your git repository.

1 Like

Hi, yes I can
https://app.netlify.com/sites/unruffled-euclid-43cc20/deploys/6185b893311dd318ae3ae210

Thank @dimola7

This is the relevant section of the deploy log

10:07:23 AM: Treating warnings as errors because process.env.CI = true.
10:07:23 AM: Most CI servers set it automatically.
10:07:23 AM: 
10:07:23 AM: Failed to compile.
10:07:23 AM: 
10:07:23 AM: src/app/components/SocialMedia/SocialMedia.jsx
10:07:23 AM:   Line 2:8:    'socialStyle' is defined but never used                                                                    no-unused-vars
10:07:23 AM:   Line 21:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
10:07:23 AM:   Line 28:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
10:07:23 AM:   Line 35:17:  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images  jsx-a11y/alt-text
10:07:23 AM: src/app/pages/Feedback/Feedback.jsx
10:07:23 AM:   Line 2:17:  'useState' is defined but never used  no-unused-vars
10:07:23 AM: src/app/pages/GameView/GameView.jsx
10:07:23 AM:   Line 4:10:  'io' is defined but never used                no-unused-vars
10:07:23 AM:   Line 42:9:  'history' is assigned a value but never used  no-unused-vars
10:07:23 AM: src/app/pages/Mobile/Mobile.jsx
10:07:23 AM:   Line 2:17:  'useState' is defined but never used  no-unused-vars
10:07:23 AM: src/app/pages/Onboarding/Onboarding.jsx
10:07:23 AM:   Line 9:8:   'image' is defined but never used  no-unused-vars
10:07:23 AM:   Line 10:8:  'wave' is defined but never used   no-unused-vars
10:07:24 AM: error Command failed with exit code 1.

There are warnings from React which as the first lines above mention are treated as errors.

You have two options:

  1. Address each of the issues above by removing the unused variables, adding alt prop to <img> tags, etc.
  2. Ignore these warning by changing CI to false by changing your build command from yarn build to CI='' yarn build.
1 Like

So that fixed that problem, thank you, but now it says its live
https://app.netlify.com/sites/unruffled-euclid-43cc20/deploys/6185c172bada3726a79b9157

but this is where the link takes me

Starting to deploy site from 'client'

You need to change the publish directory to build (or client/build if you have client as the base directory) which is the default output directory for React.

I’ll link to this Support Guide too just for reference

1 Like

Thank you @coelmay it works perfectly, only problem are these numbers that come before the url
Screen Shot 2021-11-06 at 1.00.04 AM

okay, nevermind, I removed them and the site still works. Thank you so much

Great to hear you got it working.

For reference, those numbers are the unique id of the deploy preview. Each deploy has one that never changes, so you can view old deploys, rollback, or lock to a specific deploy while testing new deploys instead of sending them straight to productions.

1 Like

Okay, that makes sense, thank you again