Skip to content

Problem with hot reload example on Node v18 LTS #344

Closed
@mdavidmorton

Description

@mdavidmorton

This probably touches several parts of this project. I wanted to make sure it was documented for anyone trying to get this example to work.

I'm currently running Node 18 LTS on macOS. I believe it also affects v17 and higher.

hot-reload git:(master) ✗ ./node_modules/.bin/webpack --config webpack.config.js --watch

webpack is watching the files…

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

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/.../django-webpack-loader/examples/hot-reload/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/.../django-webpack-loader/examples/hot-reload/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/.../django-webpack-loader/examples/hot-reload/node_modules/webpack/lib/NormalModule.js:471:10)
    at /.../django-webpack-loader/examples/hot-reload/node_modules/webpack/lib/NormalModule.js:503:5
    at /.../django-webpack-loader/examples/hot-reload/node_modules/webpack/lib/NormalModule.js:358:12
    at /.../django-webpack-loader/examples/hot-reload/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/.../django-webpack-loader/examples/hot-reload/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/.../django-webpack-loader/examples/hot-reload/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /.../django-webpack-loader/examples/hot-reload/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/.../django-webpack-loader/examples/hot-reload/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /.../django-webpack-loader/examples/hot-reload/node_modules/babel-loader/lib/index.js:44:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.14.2

Here is a workaround.

I was able to get hot-reloading to work with this project and Webpack 5, but there might be other issues I'm not aware of with that version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions