loglabs/mltrace

Node shifted LTS from 16 to 18 leading to server build failure

rishabh-thukral opened this issue · 0 comments

Hi,
Building server following the quickstart guide fails with the following error:

=> ERROR [mltrace-frontend build 8/8] RUN yarn build                                                                                                                                                  3.9s
------                                                                                                                                                                                                      
 > [mltrace-frontend build 8/8] RUN yarn build:                                                                                                                                                             
#0 1.125 yarn run v1.22.19                                                                                                                                                                                  
#0 1.181 $ react-scripts build                                                                                                                                                                              
#0 3.106 Creating an optimized production build...                                                                                                                                                          
#0 3.747 Error: error:0308010C:digital envelope routines::unsupported                                                                                                                                       
#0 3.747     at new Hash (node:internal/crypto/hash:71:19)                                                                                                                                                  
#0 3.747     at Object.createHash (node:crypto:133:10)                                                                                                                                                      
#0 3.747     at module.exports (/usr/src/app/node_modules/webpack/lib/util/createHash.js:135:53)                                                                                                            
#0 3.747     at NormalModule._initBuildHash (/usr/src/app/node_modules/webpack/lib/NormalModule.js:417:16)                                                                                                  
#0 3.747     at handleParseError (/usr/src/app/node_modules/webpack/lib/NormalModule.js:471:10)                                                                                                             
#0 3.747     at /usr/src/app/node_modules/webpack/lib/NormalModule.js:503:5                                                                                                                                 
#0 3.747     at /usr/src/app/node_modules/webpack/lib/NormalModule.js:358:12
#0 3.747     at /usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
#0 3.747     at iterateNormalLoaders (/usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
#0 3.747     at iterateNormalLoaders (/usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
#0 3.747     at /usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:236:3
#0 3.747     at runSyncOrAsync (/usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
#0 3.747     at iterateNormalLoaders (/usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
#0 3.747     at Array.<anonymous> (/usr/src/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
#0 3.747     at Storage.finished (/usr/src/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
#0 3.747     at /usr/src/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
#0 3.764 /usr/src/app/node_modules/react-scripts/scripts/build.js:19
#0 3.764   throw err;

This announcement from Node.js notified that version 18 would be the LTS and the server frontend dockerfile uses node:lts as the base image to build frontend. However, it might have used version 16 when it used to be LTS. There are some workaround shared here and here.