Skip to content

webpack examples fail locally on Node.js 18 (LTS) #686

@MikeMcC399

Description

@MikeMcC399

Problem description

The webpack examples report success (with a deprecation warning) when run on GitHub.

When they are run locally on Node.js 18, which is currently the Node.js active Long Term Support (LTS) version, they fail.

The associated action and source files are:

An example of the deprecation warning resulting from running on GitHub can be found in run 6303278763.

Steps to reproduce

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

cd examples/webpack
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 Compiled successfully.
v16.18.1 DeprecationWarning [DEP0111]
Compiled successfully.
v18.12.1 Error: error:0308010C:digital envelope routines::unsupported

Expectation

Analysis

cypress-io/github-action/ currently always runs under Node.js 16.13.0 (see #642). Running under this version causes only a deprecation warning.

If a local test is being carried out on Node.js 18, this fails because the examples are using webpack v4, whereas a minimum version of webpack v5.61.0 is needed to support Node.js >= 17 .

"webpack": "4",
"webpack-cli": "3",
"webpack-dev-server": "3.11.0"

"webpack": "4",
"webpack-cli": "3",
"webpack-dev-server": "3.11.0"

Suggested fix

For

in webpack.config.js

bump

then add

  • a .gitignore file containing dist/.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions