humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
66 stars 7 forks source link

Run github action with node 16 #129

Closed mattheu closed 1 year ago

mattheu commented 1 year ago

Github action to run JS tests is failing. I believe this is because it is running on Node v18. Locally it fails for me with Node 18 too, but works OK with Node 16. Quick fix is to run the action on Node 16 too,

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 (/home/runner/work/authorship/authorship/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/runner/work/authorship/authorship/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/runner/work/authorship/authorship/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/runner/work/authorship/authorship/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/runner/work/authorship/authorship/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/runner/work/authorship/authorship/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/runner/work/authorship/authorship/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/runner/work/authorship/authorship/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/runner/work/authorship/authorship/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/home/runner/work/authorship/authorship/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at makeSourceMapAndFinish (/home/runner/work/authorship/authorship/node_modules/ts-loader/dist/index.js:58:5)
    at successLoader (/home/runner/work/authorship/authorship/node_modules/ts-loader/dist/index.js:[40](https://github.com/humanmade/authorship/actions/runs/4573315183/jobs/8073601355?pr=128#step:7:41):5)
    at Object.loader (/home/runner/work/authorship/authorship/node_modules/ts-loader/dist/index.js:23:5)
    at LOADER_EXECUTION (/home/runner/work/authorship/authorship/node_modules/loader-runner/lib/LoaderRunner.js:119:14) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
johnbillion commented 1 year ago

Might be an idea to add a .nvmrc file and then add node-version-file: '.nvmrc' to the Setup Node job

mattheu commented 1 year ago

Might be an idea to add a .nvmrc file and then add node-version-file: '.nvmrc' to the Setup Node job

Oh neat. I didn't know you could do that 👍