Yarn build is not optimized
I've defined
yarn build
as my Build Command for a React website, however in the deploy logs I get:
What am I missing?25 Replies
Project ID:
b61d7fc0-1624-4c8a-ae9b-1a2a06f6e706
You might find these helpful:
- First time deploying issue
- Error generating domain
- Deploy is hitting Typescript Errors, but Yarn Run build and yarn run lint don't produce these errors
⚠️ experimental feature
b61d7fc0-1624-4c8a-ae9b-1a2a06f6e706
send your package.json?
Had to split to due to char limit
is this a csr rendered site?
Correct
well I see you have put build twice in the build script
It's already there twice no?
react-scripts build --max_old_space_size=8000 build
build build
what do you have defined as your build and start commands in the service settingsI just have this in build and nothing in the deploy section
I see, you're saying it should just be there once?
do you have anything set here?
hey - yarn dev here! you should change it to
NODE_OPTIONS=--max-old-space-size=8000 react-scripts build
I don't have anything defined here, should I?
I'm still getting same issue:
Are you on the latest version of react-scripts and associated tooling?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Looks like it
Thank, will try
also worth mentioning, react-scripts start, starts a development server and you should never use that in production, please use serve in your start command instead to serve the folder that was built
Thanks @Brody - can you please confirm the exact command? I'm not a JS dev.
I'm also assuming this should be defined as a "Start Command"?
scripts.start
in the package.json file
serve build -s -p $PORT
theres no need to define any build or start commands in the service settings, you can define them in the package.json fileThank you
no problem!
If I try to add server
npm i serve
I get some conflict errors - can you please point on how to best address this?
Fix the upstream dependency conflict or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.