ever-co / ever-traduora

Ever® Traduora™ - Open Translation Management Platform - https://traduora.co
https://traduora.co
GNU Affero General Public License v3.0
1.97k stars 197 forks source link

Compile from source fails for Node 18 or 20 (on MacOS) #404

Open ncul777 opened 3 months ago

ncul777 commented 3 months ago

Describe the bug I tried to compile Traduora from source with Node 20.11.1 but build step failed. Same with Node 18.20.2. Node 16.20.2 works fine.

To Reproduce Steps to reproduce the behavior:

  1. Follow instructions at https://docs.traduora.co/docs/deployment#from-source
  2. Download and install latest release of NVM with homebrew
  3. On command line nvm install 20
  4. run ./bin/build.sh
  5. Error below will occur (log show the build step only)
yarn run v1.22.22
$ ng build --prod
Option "--prod" is deprecated: Use "--configuration production" instead.
⠼ Generating browser application bundles (phase: building)...node:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at BulkUpdateDecorator.hashFactory (/Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/util/createHash.js:145:18)
    at BulkUpdateDecorator.update (/Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:77:8)
    at NormalModule._initBuildHash (/Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/NormalModule.js:880:17)
    at handleParseResult (/Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/NormalModule.js:946:10)
    at /Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/NormalModule.js:1040:4
    at processResult (/Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/NormalModule.js:755:11)
    at /Documents/tutorials/traduora/ever-traduora/webapp/node_modules/webpack/lib/NormalModule.js:819:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.20.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behaviour Build to success as per node 16

$ ng build --prod
Option "--prod" is deprecated: Use "--configuration production" instead.
✔ Browser application bundle generation complete.
✔ ES5 bundle generation complete.
✔ Copying assets complete.
⠋ Generating index html...1 rules skipped due to selector errors:
  .custom-file-input:lang(en)~.custom-file-label -> unmatched pseudo-class :lang
✔ Index html generation complete.

Initial Chunk Files                      | Names                |      Size
main-es5.1df1a7d76d2967caf7ec.js         | main                 | 728.24 kB
main-es2015.1df1a7d76d2967caf7ec.js      | main                 | 645.60 kB
styles.01bbf1914c416814cd7b.css          | styles               | 182.21 kB
polyfills-es5.00dde4f22ff936a53b64.js    | polyfills-es5        | 138.58 kB
polyfills-es2015.7d57b9012fdef083784f.js | polyfills            |  44.74 kB
runtime-es2015.248076d76e54e7267a25.js   | runtime              |   3.14 kB
runtime-es5.248076d76e54e7267a25.js      | runtime              |   3.14 kB

                                         | Initial ES5 Total    |   1.03 MB
                                         | Initial ES2015 Total | 875.70 kB

Lazy Chunk Files                         | Names                |      Size
760-es5.76ecd20087d1425fdf6f.js          | -                    | 166.65 kB
760-es2015.76ecd20087d1425fdf6f.js       | -                    | 153.78 kB

Build at: 2024-04-25T10:07:30.803Z - Hash: 24f6c26d036f7f0d6a25 - Time: 52327ms
✨  Done in 63.20s.
yarn run v1.22.22
$ tsc && copyfiles src/templates/**/* ../dist
✨  Done in 11.50s.

Environment: