I have a problem to deploy react app to render. I'm try to deploy this app but I see some errors

Hello everyone,

I have a problem to deploy react app to render. I’m try to deploy this app but I see this error : Exited with status 1 while building your code.

So I’m created a mern app. And I’m deploy express js from github to render succesfully. But when I’m trying to deploy React js to render using web static service by render. I see 2 errors every time.

1- Error number 1 : Exited with status 1 while building your code. Logs errors are like :

RubyGems installed the following executables:
	/opt/render/project/rubies/ruby-3.2.2/bin/gem
	/opt/render/project/rubies/ruby-3.2.2/bin/bundle
	/opt/render/project/rubies/ruby-3.2.2/bin/bundler
RubyGems system software updated
==> Using Python version 3.7.0 via environment variable PYTHON_VERSION
==> Docs on specifying a Python version: https://render.com/docs/python-version
==> Using Poetry version 1.5.1 via environment variable POETRY_VERSION
==> Docs on specifying a Poetry version: https://render.com/docs/poetry-version
==> Installing Poetry version 1.5.1

this is the image of error n1 to understand more:

I’m trying to edit environment of PYTHON_VERSION, NODE_VERSION, POETRY_VERSION and RUBY_VERSION many times with many versions as it exist in docs, but the same error showing.

2- Error Number Two: Exited with status 1 while building your code. Logs errors are like :

   To get started you need Poetry's bin directory (/opt/render/project/poetry/bin) in your    `PATH`
environment variable.
Add `export PATH="/opt/render/project/poetry/bin:$PATH"` to your shell configuration file.
Alternatively, you can call Poetry explicitly with `/opt/render/project/poetry/bin/poetry`.
You can test that everything is set up by executing:
`poetry --version`
==> Running build command 'yarn build'...
yarn run v1.22.21
error Couldn't find a package.json file in "/opt/render/project/src/client"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
==> Build failed 😞

this is the image of error n2 to understand more :

I’m trying to edit build command every time with these commands :

  •  `yarn build`                 
    
  •  `yarn run build`                      
    
  •  `npm run build`                          
    

But the same error showing here. I don’t know what is the problem exact. I’m searching for many solutions in the internet, but without results.

Anyone can help me here.

I am ready to explain further if there is anything unclear about my problem. Just leave a comment and I will explain more. I am waiting for your answer.

Thank you so much.

For error N1 : I’m trying to edit environment of PYTHON_VERSION, NODE_VERSION, POETRY_VERSION and RUBY_VERSION many times with many versions as it exist in docs, but the same error showing.

For error N2: I’m trying to edit build command every time with these commands :

  • yarn build
  • yarn run build
  • npm run build

But the same error showing here. I don’t know what is the problem exact. I’m searching for many solutions in the internet, but without results.

Hi there,

Sorry for any confusion here. When building static sites, we only use a single build image, so all the tools are included (Node, Ruby, Python etc.), but depending on the static site framework you use, you only really care about configuring one of them. Seeing you are building a React app, you would only care about setting the NodeJS version, the others you can ignore and our defaults will be installed. So to begin with remove any settings you have besides NODE_VERSION.

For a React app, yarn build or npm run build would be the correct build command, depending on which package manager you use locally. However, the error error Couldn't find a package.json file in "/opt/render/project/src/client" indicates there is no package.json in the root of your git repo. Is this in the root of the Git repo, or is your React app in a sub-directory?

Regards,

Keith
Render Support, UTC+10 :australia:

After do what you say. I see this error again :

==> Running build command ‘npm run build --force --legacy-peer-deps’…

Dec 20 10:21:09 PM

Dec 20 10:21:09 PM> paxon platform@0.1.0 build

Dec 20 10:21:09 PM> react-scripts build

Dec 20 10:21:09 PM

Dec 20 10:21:09 PMsh: 1: react-scripts: not found

Dec 20 10:21:09 PM==> Build failed :disappointed:

Can you help me pls…

Hi there,

Is react-scripts included in your dependencies?

Regards,

Keith
Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.