React app cant build in pages

I am trying to deploy my react app to CF Pages from github. I am able to run the build on my machine, however the build errors when running on CF servers. Here is my log:

2023-10-05T14:28:44.646207Z	Cloning repository...
2023-10-05T14:28:45.545194Z	From https://github.com/prushton2/prushton2.github.io
2023-10-05T14:28:45.545936Z	 * branch            f9a8c82dc724b20fea5b7fe513dabb30833ea39e -> FETCH_HEAD
2023-10-05T14:28:45.546179Z	
2023-10-05T14:28:45.595244Z	HEAD is now at f9a8c82 rebuilt packages
2023-10-05T14:28:45.595909Z	
2023-10-05T14:28:45.707251Z	
2023-10-05T14:28:45.741519Z	Success: Finished cloning repository files
2023-10-05T14:28:46.439948Z	Restoring from dependencies cache
2023-10-05T14:28:46.464421Z	Restoring from build output cache
2023-10-05T14:28:46.853923Z	Detected the following tools from environment: [email protected], [email protected]
2023-10-05T14:28:46.854841Z	Installing project dependencies: yarn
2023-10-05T14:28:47.630463Z	➀ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker πŸ‘
2023-10-05T14:28:47.630852Z	
2023-10-05T14:28:47.79593Z	➀ YN0000: β”Œ Resolution step
2023-10-05T14:28:48.825629Z	➀ YN0032: β”‚ fsevents@npm:2.3.3: Implicit dependencies on node-gyp are discouraged
2023-10-05T14:28:48.996272Z	➀ YN0061: β”‚ workbox-webpack-plugin@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:49.852598Z	➀ YN0061: β”‚ @babel/plugin-proposal-numeric-separator@npm:7.18.6 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
2023-10-05T14:28:49.859523Z	➀ YN0061: β”‚ @babel/plugin-proposal-nullish-coalescing-operator@npm:7.18.6 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
2023-10-05T14:28:49.862623Z	➀ YN0061: β”‚ @babel/plugin-proposal-private-methods@npm:7.18.6 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
2023-10-05T14:28:49.931038Z	➀ YN0061: β”‚ @babel/plugin-proposal-class-properties@npm:7.18.6 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
2023-10-05T14:28:49.953193Z	➀ YN0061: β”‚ @babel/plugin-proposal-private-property-in-object@npm:7.21.11 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
2023-10-05T14:28:50.024968Z	➀ YN0061: β”‚ @babel/plugin-proposal-optional-chaining@npm:7.21.0 is deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
2023-10-05T14:28:50.593749Z	➀ YN0061: β”‚ workbox-build@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:51.006528Z	➀ YN0061: β”‚ svgo@npm:1.3.2 is deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x.
2023-10-05T14:28:53.263439Z	➀ YN0061: β”‚ rollup-plugin-terser@npm:7.0.2 is deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
2023-10-05T14:28:53.349201Z	➀ YN0061: β”‚ workbox-recipes@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.364527Z	➀ YN0061: β”‚ workbox-broadcast-update@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.375938Z	➀ YN0061: β”‚ workbox-expiration@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.396347Z	➀ YN0061: β”‚ workbox-navigation-preload@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.436195Z	➀ YN0061: β”‚ workbox-core@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.458433Z	➀ YN0061: β”‚ workbox-background-sync@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.4643Z	➀ YN0061: β”‚ workbox-google-analytics@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.481807Z	➀ YN0061: β”‚ workbox-cacheable-response@npm:6.6.1 is deprecated: [email protected]
2023-10-05T14:28:53.494789Z	➀ YN0061: β”‚ memfs@npm:3.6.0 is deprecated: this will be v4
2023-10-05T14:28:53.499087Z	➀ YN0061: β”‚ workbox-window@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.509263Z	➀ YN0061: β”‚ workbox-strategies@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.518767Z	➀ YN0061: β”‚ workbox-precaching@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.544961Z	➀ YN0061: β”‚ workbox-range-requests@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.555463Z	➀ YN0061: β”‚ workbox-routing@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.629932Z	➀ YN0061: β”‚ workbox-sw@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.647742Z	➀ YN0061: β”‚ workbox-streams@npm:6.6.1 is deprecated: this package has been deprecated
2023-10-05T14:28:53.733503Z	➀ YN0061: β”‚ stable@npm:0.1.8 is deprecated: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
2023-10-05T14:28:56.002701Z	➀ YN0061: β”‚ sourcemap-codec@npm:1.4.8 is deprecated: Please use @jridgewell/sourcemap-codec instead
2023-10-05T14:28:56.986824Z	➀ YN0061: β”‚ w3c-hr-time@npm:1.0.2 is deprecated: Use your platform's native performance.now() and performance.timeOrigin.
2023-10-05T14:29:03.616812Z	➀ YN0002: β”‚ eslint-config-react-app@npm:7.0.1 [97398] doesn't provide @babel/plugin-syntax-flow (p8e9f4), requested by eslint-plugin-flowtype
2023-10-05T14:29:03.617897Z	➀ YN0002: β”‚ eslint-config-react-app@npm:7.0.1 [97398] doesn't provide @babel/plugin-transform-react-jsx (p582b1), requested by eslint-plugin-flowtype
2023-10-05T14:29:03.618305Z	➀ YN0002: β”‚ prushton.com@workspace:. doesn't provide @testing-library/dom (paf00d), requested by @testing-library/user-event
2023-10-05T14:29:03.618585Z	➀ YN0000: β”‚ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
2023-10-05T14:29:03.619601Z	➀ YN0000: β”” Completed in 15s 824ms
2023-10-05T14:29:03.708698Z	➀ YN0000: β”Œ Post-resolution validation
2023-10-05T14:29:03.709062Z	➀ YN0028: β”‚ The lockfile would have been modified by this install, which is explicitly forbidden.
2023-10-05T14:29:03.709275Z	➀ YN0000: β”” Completed
2023-10-05T14:29:03.709474Z	➀ YN0000: Failed with errors in 15s 915ms
2023-10-05T14:29:03.820584Z	Error: Exit with error code: 1
2023-10-05T14:29:03.820948Z	    at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
2023-10-05T14:29:03.821141Z	    at Object.onceWrapper (node:events:652:26)
2023-10-05T14:29:03.821315Z	    at ChildProcess.emit (node:events:537:28)
2023-10-05T14:29:03.821456Z	    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2023-10-05T14:29:03.829054Z	Failed: build command exited with code: 1
2023-10-05T14:29:04.859329Z	Failed: error occurred while running build command
1 Like

You’re using Yarn 1 but v2 build system uses v3 by default and it wants to change the lock file

Add YARN_VERSION env var with the value of 1

2 Likes

Thanks, this finally worked!

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