Skip to content

Failed to start app with NodeJS newest version v17.0.1 #5778

Closed

Description

@TranXuanHoang

🐛 Bug Report

Starting up the app with the newest NodeJS version (17.0.1) failed with the following error:

npm start

> [email protected] start
> docusaurus start

Starting the development server...
Docusaurus website is running at "http://localhost:3000/".

* Client █████████████████████████ setup (3%)
 watch run

node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (C:\mydocs\node_modules\webpack\lib\util\createHash.js:155:18)
    at BulkUpdateDecorator.digest (C:\mydocs\node_modules\webpack\lib\util\createHash.js:80:21)
    at C:\mydocs\node_modules\webpack\lib\DefinePlugin.js:595:38
    at _next33 (eval at create (C:\mydocs\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:57:1)
    at _next11 (eval at create (C:\mydocs\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:189:1)
    at Hook.eval [as call] (eval at create (C:\mydocs\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:239:1)
    at Hook.CALL_DELEGATE [as _call] (C:\mydocs\node_modules\tapable\lib\Hook.js:14:14)
    at Compiler.newCompilation (C:\mydocs\node_modules\webpack\lib\Compiler.js:1053:26)
    at C:\mydocs\node_modules\webpack\lib\Compiler.js:1097:29
    at Hook.eval [as callAsync] (eval at create (C:\mydocs\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\mydocs\node_modules\tapable\lib\Hook.js:18:14)
    at Compiler.compile (C:\mydocs\node_modules\webpack\lib\Compiler.js:1092:28)
    at C:\mydocs\node_modules\webpack\lib\Watching.js:200:19
    at Hook.eval [as callAsync] (eval at create (C:\mydocs\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:22:1) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.0.1

Prerequisites

NodeJS version v17.0.1
Docusaurus newest version 2.0.0-beta.8

Description

After upgrading Node.js to the newest version (v17.0.1), then creating a new Docusaurus project following the instructions on this page, the project was created successfully but failed when being started with npm start. It seems that there is an error related to Nodejs's crypto module causing the start of the Docusaurus app crashed.

Have you read the Contributing Guidelines on issues?

YES

Steps to reproduce

Use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.

As we don't know eactly which Node's version CodeSandbox is using, this step is skipped.

  1. Step 1... Upgrade NodeJS to the newest version v17.0.1
  2. Step 2... Create a new Docusaurus project npm init docusaurus@latest mydocs
  3. Step 3... cd into mydocs directory and run npm start (currently this command fails to start the app)

Expected behavior

Should be able to start up the app

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used: 2.0.0-beta.8
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node.js 17.0.1
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10

Activity

  1. added
    bug
    status: needs triage
    on Oct 24, 2021
  2. changed the title [-]Fails to start app with NodeJS newest version v17.0.1[/-] [+]Failed to start app with NodeJS newest version v17.0.1[/+] on Oct 24, 2021
  3. Josh-Cena commented on Oct 24, 2021

    @Josh-Cena
    Collaborator
  4. lex111 commented on Oct 25, 2021

    @lex111
    Contributor

    BTW as a temporary solution you can use export NODE_OPTIONS=--openssl-legacy-provider && npm start for now.

  5. JonnyBurger commented on Oct 25, 2021

    @JonnyBurger
    Contributor

    At Remotion we managed to fix it using:

    1. Setting output.hashFunction to "xxhash64"
    2. Upgrading to Webpack 5.60.0
  6. removed
    status: needs triage
    on Oct 28, 2021
  7. pkosiec commented on Jan 13, 2022

    @pkosiec

    Hello all,

    I was able to reproduce the same issue with latest Docusaurus (2.0.0-beta.14). When I updated the Docusaurus along with the Node.js 17 bump on GitHub Actions pipeline (we use Ubuntu latest), the CI job started to fail.

    When I added the suggested workaround (capactio/website@b5155b9), the pipeline succeeded (https://github.com/capactio/website/runs/4801264332?check_suite_focus=true).

    I don't have any issues on macOS Monterey 12.1. Is it something on my end or the bug is still there?

    Cheers!

  8. slorber commented on Jan 13, 2022

    @slorber
    Collaborator

    @pkosiec try to re-gen your lockfile and look for older versions of webpack in node modules. If you are using a newer webpack it should work

  9. pkosiec commented on Jan 13, 2022

    @pkosiec

    Thank you @slorber for your help! While I had correct webpack version in node_modules on my machine, apparently the lockfile caused downloading older webpack on GitHub Actions pipeline. Removing and generating it again helped 👍

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions