Skip to content

Conversation

@cattailsswing
Copy link

This PR fixes a build failure for the frontend static site (render-todo) when deploying on modern Node.js versions (v17 and higher).

The Problem

The project uses react-scripts@4.0.3, which relies on an old crypto algorithm (MD4). Modern Node.js versions have disabled this algorithm for security reasons, causing the build to fail with an ERR_OSSL_EVP_UNSUPPORTED error.

The Solution

This PR makes two changes to the frontend/package.json file to fix the build:

  1. Sets Node.js version: Adds an engines field to pin the Node.js version to 18.x, which is a compatible LTS release.
    "engines": {
      "node": "18.x.x"
    },
  2. Enables legacy crypto: Adds the NODE_OPTIONS=--openssl-legacy-provider flag to the build script. This tells Node 18 to load the old crypto library that react-scripts@4.0.3 requires to run.
    "build": "NODE_OPTIONS=--openssl-legacy-provider react-scripts build",

These changes allow the project to build successfully on Render (as of Oct 22, 2025).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant