#Build failing for simple react app

1 messages · Page 1 of 1 (latest)

ashen hullBOT
#

Project ID: N/A

late crest
#

#7 [stage-0 3/10] COPY .nixpacks/nixpkgs-ffca9ffaaafb38c8979068cee98b2644bd3f14cb.nix .nixpacks/nixpkgs-ffca9ffaaafb38c8979068cee98b2644bd3f14cb.nix
#7 sha256:de181c777f143edcada09455ae9387c7f5571f30bb55deae38586595176acf9f
#7 CACHED

#5 [stage-0 2/8] WORKDIR /app/
#5 sha256:46f35bb14209f31cddb6d0e80d42b3ceb58d2f45672a3486e22a069140ac06a3
#5 CACHED

#8 [stage-0 4/10] RUN nix-env -if .nixpacks/nixpkgs-ffca9ffaaafb38c8979068cee98b2644bd3f14cb.nix && nix-collect-garbage -d
#8 sha256:03357187dacdb89c3a1b22858aabb744d77d7abe501deeb5a8a2780116a4b7a7
#8 CACHED

#

#9 [stage-0 5/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile
#9 sha256:21d1b6484e7a1b33d81bd7e7bca694134745685644e48eeb35a62d55b2f63108

#9 DONE 0.6s

#10 [stage-0 6/10] COPY . /app/.
#10 sha256:cfbfa59db778d175f31890680f69b8f8de6a07923f1f8923ed1a6ed854a25f1b
#10 DONE 0.1s

#11 [stage-0 7/10] RUN --mount=type=cache,id=s/7ff051d5-ea23-447b-b391-24e00d3ac099-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile
#11 sha256:1443a49c878c660a8bc7ccbc6686189bb548f99c39619362a53df659c6c661df

#11 0.725 yarn install v1.22.19

#11 0.815 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
#11 0.819 [1/4] Resolving packages...

#11 1.022 warning Lockfile has incorrect entry for "fsevents@^1.2.7". Ignoring it.

#11 1.418 warning react-scripts > webpack-dev-server > chokidar > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
#11 1.419 warning react-scripts > babel-jest > @jest/transform > jest-haste-map > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

#11 1.619 [2/4] Fetching packages...

#11 16.43 [3/4] Linking dependencies...
#11 16.43 warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5".
#11 16.43 warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".

#11 22.78 [4/4] Building fresh packages...

#11 23.43 Done in 22.71s.

#11 DONE 23.7s

#

#12 [stage-0 8/10] COPY . /app/.
#12 sha256:ac26b2a6a371a628d9e63c87f3d2f7e4bc98be904fb0c12b856ca6feadaf8aeb
#12 DONE 0.1s

#13 [stage-0 9/10] RUN --mount=type=cache,id=s/7ff051d5-ea23-447b-b391-24e00d3ac099-node_modules/cache,target=/app/node_modules/.cache yarn run build
#13 sha256:09c61157dc97094b8ef551886038263e41d9f0078541ee67c6683c276ff1bf44

#13 0.507 yarn run v1.22.19
#13 0.541 $ react-scripts build

#13 1.797 Creating an optimized production build...

#13 2.060 Error: error:0308010C:digital envelope routines::unsupported
#13 2.060 at new Hash (node:internal/crypto/hash:71:19)
#13 2.060 at Object.createHash (node:crypto:130:10)
#13 2.060 at module.exports (/app/node_modules/webpack/lib/util/createHash.js:135:53)
#13 2.060 at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:417:16)
#13 2.060 at handleParseError (/app/node_modules/webpack/lib/NormalModule.js:471:10)
#13 2.060 at /app/node_modules/webpack/lib/NormalModule.js:503:5
#13 2.060 at /app/node_modules/webpack/lib/NormalModule.js:358:12
#13 2.060 at /app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
#13 2.060 at iterateNormalLoaders (/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
#13 2.060 at iterateNormalLoaders (/app/node_modules/loader-runner/lib/LoaderRunner.js:221:10)

#13 2.060 at /app/node_modules/loader-runner/lib/LoaderRunner.js:236:3
#13 2.060 at runSyncOrAsync (/app/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
#13 2.060 at iterateNormalLoaders (/app/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
#13 2.060 at Array.<anonymous> (/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
#13 2.060 at Storage.finished (/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
#13 2.060 at /app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9

#

#13 2.390 /app/node_modules/react-scripts/scripts/build.js:19
#13 2.390 throw err;
#13 2.390 ^
#13 2.390
#13 2.390 Error: error:0308010C:digital envelope routines::unsupported
#13 2.390 at new Hash (node:internal/crypto/hash:71:19)
#13 2.390 at Object.createHash (node:crypto:130:10)
#13 2.390 at module.exports (/app/node_modules/webpack/lib/util/createHash.js:135:53)
#13 2.390 at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:417:16)
#13 2.390 at /app/node_modules/webpack/lib/NormalModule.js:452:10
#13 2.390 at /app/node_modules/webpack/lib/NormalModule.js:323:13
#13 2.390 at /app/node_modules/loader-runner/lib/LoaderRunner.js:367:11
#13 2.390 at /app/node_modules/loader-runner/lib/LoaderRunner.js:233:18
#13 2.390 at context.callback (/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
#13 2.390 at /app/node_modules/babel-loader/lib/index.js:55:103
#13 2.390 at processTicksAndRejections (node:internal/process/task_queues:96:5) {
#13 2.390 opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
#13 2.390 library: 'digital envelope routines',
#13 2.390 reason: 'unsupported',
#13 2.390 code: 'ERR_OSSL_EVP_UNSUPPORTED'
#13 2.390 }
#13 2.421 error Command failed with exit code 1.
#13 2.421 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c yarn run build]: exit code: 1


[stage-0 9/10] RUN --mount=type=cache,id=s/7ff051d5-ea23-447b-b391-24e00d3ac099-node_modules/cache,target=/app/node_modules/.cache yarn run build:


executor failed running [/bin/bash -ol pipefail -c yarn run build]: exit code: 1

Error: Docker build failed

late crest
#

fixed it:

  1. updated react to higher than 5 version
  2. commenting unused import
elfin prism
#

18 is the latest. What version are you using now

#

And that TS version looks really old aswell