Skip to content

Version 6 (for Webpack 4) does not work on Node 18+ #364

@renchap

Description

@renchap

Bug report

When running Webpack 4 with the latest version of this plugin on Node 18 (thanks to the new Webpack 4 version), it fails with this error:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at /Users/renchap/dev/mastodon/mastodon/node_modules/compression-webpack-plugin/dist/index.js:230:42
    at CompressionPlugin.compress (/Users/renchap/dev/mastodon/mastodon/node_modules/compression-webpack-plugin/dist/index.js:319:9)
    at /Users/renchap/dev/mastodon/mastodon/node_modules/compression-webpack-plugin/dist/index.js:340:12
    at _next1 (eval at create (/Users/renchap/dev/mastodon/mastodon/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:37:17)
    at eval (eval at create (/Users/renchap/dev/mastodon/mastodon/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:64:1)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Actual Behavior

Build fails with the error above

Expected Behavior

The build should complete without error on Node 18

How Do We Reproduce?

This can be reproduced on Mastodon with this PR: mastodon/mastodon#26830 (look at the failed github actions)

Please paste the results of npx webpack-cli info here, and mention other relevant information

Webpack version 4.47.0
compression-webpack-plugin version 6.1.1 (latest version compatible with Webpack 4)

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