Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-scripts used in example-wait-on fail locally on Node.js 18 (LTS) #687

Closed
MikeMcC399 opened this issue Dec 28, 2022 · 2 comments
Closed

Comments

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 28, 2022

The react-scripts which are used in the workflow example-wait-on fail if they are used locally with npm start and the environment has Node.js 18 installed.

Problem description

When react-scripts examples are run locally on Node.js 18, which is currently the Node.js active Long Term Support (LTS) version, they fail with the message:

"Error: error:0308010C:digital envelope routines::unsupported".

The associated action and source files are:

Steps to reproduce

Open a terminal window on a local clone of the repository:

cd examples/react-scripts
nvm use 18.12.1
npm ci
npm start

Note:
"Error: error:0308010C:digital envelope routines::unsupported"

Results for supported Node.js versions

Executing npm start gives:

Node.js for v9 and v10 examples
v14.21.1 No error
v16.18.1 No error
v18.12.1 Error: error:0308010C:digital envelope routines::unsupported

Expectation

npm start should succeed when it is executed in either of the directories examples/v9/react-scripts or examples/react-scripts and a supported Node.js version is installed (currently 14.x and 16.x have maintenance status; 18.x is the active LTS version).

Analysis

cypress-io/github-action/ currently always runs under Node.js 16.13.0 (see #642). Running under this version shows no error. This explains why the action does not currently fail when running on GitHub.

The examples use react-scripts 3.4.4 which pulls in webpack@4.42.0 indirectly. This is not sufficient to support running under Node.js 18, since a minimum version of webpack v5.61.0 is needed to support Node.js >= 17.

"react": "16.14.0",
"react-dom": "16.14.0",
"react-scripts": "3.4.4"

"react": "16.14.0",
"react-dom": "16.14.0",
"react-scripts": "3.4.4"

create-react-app - v5.0.0, which hosts the package react-scripts, is the first version which supports webpack v5.

Suggested fix

For

bump

Note that when running npm start, deprecation warnings appear. This is a known issue facebook/create-react-app#11860. The warnings are:

DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE
DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE
@MikeMcC399
Copy link
Collaborator Author

I plan to submit a PR also for this issue and will wait until there are no other conflicting open PRs targeting the same package-lock.json files.

@MikeMcC399
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant