Did you get hit with the "Node 17 digital envelope routines::unsupported" error?

Apparently the work around is adding NODE_OPTIONS=--openssl-legacy-provider to your scripts, like such:


  "scripts": {
    "build": "NODE_OPTIONS=--openssl-legacy-provider webpack --env.production --extractCss",
    "start": "NODE_OPTIONS=--openssl-legacy-provider webpack-dev-server --extractCss",
    "build:dev": "NODE_OPTIONS=--openssl-legacy-provider webpack --extractCss",
    "analyze": "NODE_OPTIONS=--openssl-legacy-provider webpack --env.production --analyze",
    "test": "NODE_OPTIONS=--openssl-legacy-provider au test",
    "e2e": "NODE_OPTIONS=--openssl-legacy-provider au cypress --run",
    "e2e:headless": "NODE_OPTIONS=--openssl-legacy-provider au cypress --start --run"
  },

Is there a better way, like adding something to webpack or Aurelia’s config file?

I just updated to Webpack 5.