Nuxt deployment fails

I am trying to deploy my nuxtjs app, however building the app fails. Here is the error: #13 4.022 node:internal/crypto/hash:71 #13 4.022 this[kHandle] = new _Hash(algorithm, xofLen); #13 4.022 ^ #13 4.022 #13 4.022 Error: error:0308010C:digital envelope routines::unsupported #13 4.022 at new Hash (node:internal/crypto/hash:71:19) #13 4.022 at Object.createHash (node:crypto:130:10) #13 4.022 at module.exports (/app/node_modules/webpack/lib/util/createHash.js:135:53) #13 4.022 at NormalModule._initBuildHash (/app/node_modules/webpack/lib/NormalModule.js:417:16) #13 4.022 at handleParseError (/app/node_modules/webpack/lib/NormalModule.js:471:10) #13 4.022 at /app/node_modules/webpack/lib/NormalModule.js:503:5 #13 4.022 at /app/node_modules/webpack/lib/NormalModule.js:358:12 #13 4.022 at /app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:373:3 #13 4.022 at iterateNormalLoaders (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:214:10) #13 4.022 at Array.<anonymous> (/app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:205:4) #13 4.022 at Storage.finished (/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16) #13 4.022 at /app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9 #13 4.022 at /app/node_modules/graceful-fs/graceful-fs.js:123:16 #13 4.022 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) { #13 4.022 opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], #13 4.022 library: 'digital envelope routines', #13 4.022 reason: 'unsupported', #13 4.022 code: 'ERR_OSSL_EVP_UNSUPPORTED' #13 4.022 } Could anyone help?
64 Replies
Percy
Percy2y ago
Project ID: N/A
stevenurk9494
stevenurk9494OP2y ago
n/a
Brody
Brody2y ago
can you please share your repo?
stevenurk9494
stevenurk9494OP2y ago
Okay. When using NODE_OPTIONS=--openssl-legacy-provider in env-variables, the build succeeds. However, my application (https://jpnuxt-production.up.railway.app/) now gives this error: npm ERR! path /app npm ERR! command failed npm ERR! signal SIGTERM npm ERR! command sh -c -- nuxt start
Brody
Brody2y ago
I was gonna recommend to upgrade your webpack version, using a legacy SSL provider would have been the last resort ?
stevenurk9494
stevenurk9494OP2y ago
Ah okay
stevenurk9494
stevenurk9494OP2y ago
GitHub
GitHub - stevenurk94/JP_NUXT
Contribute to stevenurk94/JP_NUXT development by creating an account on GitHub.
Brody
Brody2y ago
prob running out of memory, try upgrading to dev plan please
stevenurk9494
stevenurk9494OP2y ago
hmm okay but when I remove NODE_OPTIONS=--openssl-legacy-provider, I am getting the error as is obvious, but how can I upgrade my webpack version?
Brody
Brody2y ago
whats the current webpack version you are using
stevenurk9494
stevenurk9494OP2y ago
2.15.8
Brody
Brody2y ago
thats a very old version current is 5.77
stevenurk9494
stevenurk9494OP2y ago
"@nuxt/webpack": "2.15.8"
Brody
Brody2y ago
yeah the old webpack version uses a deprecated hashing algorithm
stevenurk9494
stevenurk9494OP2y ago
when I check my webpack version using: npm ls webpack I am getting this: └─┬ [email protected] └─┬ @nuxt/[email protected] ├─┬ @nuxt/[email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └── [email protected] deduped ├─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] deduped └─┬ [email protected] └── [email protected] deduped
Brody
Brody2y ago
^
stevenurk9494
stevenurk9494OP2y ago
and how can I upgrade it?
Brody
Brody2y ago
same way you would any package but going from 2x to 5x is gonna bring a whole bunch of other problems
stevenurk9494
stevenurk9494OP2y ago
but when checking this: https://www.npmjs.com/package/@nuxt/webpack the gap is not that big
npm
@nuxt/webpack
Latest version: 2.16.3, last published: 13 days ago. Start using @nuxt/webpack in your project by running npm i @nuxt/webpack. There are 9 other projects in the npm registry using @nuxt/webpack.
stevenurk9494
stevenurk9494OP2y ago
I installed this app 2 years ago, so I am using webpack version: 4.46.0 and I am using: @nuxt/[email protected]
Brody
Brody2y ago
try adding
output: {
hashFunction: "sha256"
}
output: {
hashFunction: "sha256"
}
to your nuxt.config.js file
stevenurk9494
stevenurk9494OP2y ago
nope. doesnt work
Brody
Brody2y ago
okay then just keep the legacy variable
stevenurk9494
stevenurk9494OP2y ago
okay\ and about this question, my usage doesnt show me using a lot of memory or cpu usage?
Brody
Brody2y ago
its not a big deal, its just hashing the files, no security risk screenshot?
stevenurk9494
stevenurk9494OP2y ago
ah okay. Well nice to know! I will try upgrading my webpack using another repo, just to see if it works
stevenurk9494
stevenurk9494OP2y ago
Brody
Brody2y ago
its possible there is a spike too thin to be displayed that hits the 512mb memory limit
stevenurk9494
stevenurk9494OP2y ago
hmm okay..
Brody
Brody2y ago
forgive me for asking but youre not Jennita right?
stevenurk9494
stevenurk9494OP2y ago
nope 😉
Brody
Brody2y ago
is that a client of yours?
stevenurk9494
stevenurk9494OP2y ago
yess
Brody
Brody2y ago
in that case you would want to be on the teams plan, so the least you could do would be to upgrade to the dev plan im sure your client wouldn't appreciate the site only running for 500 hours a month anyway
stevenurk9494
stevenurk9494OP2y ago
yeah sure, I would upgrade, the project isnt live yet.. so if I am going to use railway I need to upgrade, however I wanted to test it before upgrading but I'll try upgrading and retrying installing the ap app *
Brody
Brody2y ago
im positive you could do plenty of testing without getting charged since you get 5$ in credits every month on the dev plan
stevenurk9494
stevenurk9494OP2y ago
Well I upgraded to development plan, but I am still getting the same error: npm ERR! path /app npm ERR! command failed npm ERR! signal SIGTERM npm ERR! command sh -c -- nuxt start npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-03-31T17_43_39_232Z-debug-0.log npm WARN config production Use --omit=dev instead.
Jennita [email protected] start nuxt start
Brody
Brody2y ago
public your repo again please?
stevenurk9494
stevenurk9494OP2y ago
yess its public how can I read the logs?
Brody
Brody2y ago
wdym? youve sent me logs so you are reading them
stevenurk9494
stevenurk9494OP2y ago
Okay. But how can I access them?
Brody
Brody2y ago
in the UI like you have been
stevenurk9494
stevenurk9494OP2y ago
ah okay. Never mind, I thought that these logs maybe had some more information: /root/.npm/_logs/2023-03-31T17_43_39_232Z-debug-0.log.. but did you take a look at the repo?
Brody
Brody2y ago
not yet
stevenurk9494
stevenurk9494OP2y ago
so do you know what this error could be? npm ERR! path /app npm ERR! command failed npm ERR! signal SIGTERM npm ERR! command sh -c -- nuxt start
Brody
Brody2y ago
please be patient, im a little busy at the moment
stevenurk9494
stevenurk9494OP2y ago
ah okay. sorry ;).. just curious if you did know anything
Brody
Brody2y ago
you have done a full redeploy after upgrading to dev plan right?
stevenurk9494
stevenurk9494OP2y ago
yess! Deleted the app and even deleted my git repo
Brody
Brody2y ago
@stevenurk94 what node version do you have installed on your computer?
stevenurk9494
stevenurk9494OP2y ago
16.18.1
Brody
Brody2y ago
can i see a screenshot of your service variables please
stevenurk9494
stevenurk9494OP2y ago
Brody
Brody2y ago
show me all the base url variables
stevenurk9494
stevenurk9494OP2y ago
Brody
Brody2y ago
Jennita Photography
Fotokaarten
Steun het goede doel | Keuze uit meer dan 50 prachtige fotokaarten | Vind jouw leuke fotokaart bij Jennita Photography | Blanco, Geboorte & Verjaardag
Brody
Brody2y ago
@stevenurk94 this is the new start script
nuxt start --hostname 0.0.0.0 --port $PORT
nuxt start --hostname 0.0.0.0 --port $PORT
and add these environment variables
NODE_OPTIONS = --max_old_space_size=8192 --openssl-legacy-provider
NIXPACKS_NODE_VERSION = 16
NODE_OPTIONS = --max_old_space_size=8192 --openssl-legacy-provider
NIXPACKS_NODE_VERSION = 16
replacing your already existing NODE_OPTIONS with the variable i just provided
stevenurk9494
stevenurk9494OP2y ago
ah check okay I'll try it thank you very much!
Brody
Brody2y ago
does that mean it works?
stevenurk9494
stevenurk9494OP2y ago
Yess! It workss
Brody
Brody2y ago
awesome I do recommend you set aside some time to update to the latest version of nuxt2 or even maybe nuxt3
stevenurk9494
stevenurk9494OP2y ago
yess, sure.. this one is getting old I am going to work on that! Thanks for your help
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server