0

Tengo un proyecto desarrollado con Frontity y alojado en Vercel. Este proyecto ya está funcionando y lo he actualizado varias veces, la última fue en octubre. Hace una semana hice algunos cambios y al intentar actualizarlo me apareció el siguiente error en vercel:

[14:38:05.125] Retrieving list of deployment files...
[14:38:05.505] Downloading 43 deployment files...
[14:38:06.777] Skipping build cache since Node.js version changed from "16.x" to "18.x"
[14:38:06.823] Running "vercel build"
[14:38:07.342] Vercel CLI 28.8.0
[14:38:07.355] WARN! Did you mean to deploy the subdirectory "build"? Use `vc --cwd build` instead.
[14:38:07.472] WARN! Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
[14:38:07.483] > Installing Builder: @frontity/now
[14:38:09.967] Downloading user files...
[14:38:09.978] Warning: Detected "engines": { "node": ">=10.0.0" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version
[14:38:09.983] Installing dependencies...
[14:38:09.984] Detected `package-lock.json` generated by npm 7+...
[14:38:14.842] npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
[14:38:15.370] npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
[14:38:15.446] npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
[14:38:15.480] npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
[14:38:15.546] npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
[14:38:15.706] npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[14:38:19.467] npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
[14:38:23.979] 
[14:38:23.979] added 1087 packages in 14s
[14:38:23.979] 
[14:38:23.979] 77 packages are looking for funding
[14:38:23.979]   run `npm fund` for details
[14:38:24.003] Running "build" script in "package.json"
[14:38:24.008] Detected `package-lock.json` generated by npm 7+...
[14:38:24.008] Running "npm run build"
[14:38:24.320] 
[14:38:24.320] > [email protected] build
[14:38:24.320] > frontity build
[14:38:24.320] 
[14:38:25.798] 
[14:38:25.799]   - mode: production
[14:38:25.799]   - target: both
[14:38:25.799]   - public-path: /static/
[14:38:25.799] 
[14:38:25.836] Building es5 bundle
[14:38:26.903] Error: error:0308010C:digital envelope routines::unsupported
[14:38:26.903]     at new Hash (node:internal/crypto/hash:71:19)
[14:38:26.903]     at Object.createHash (node:crypto:133:10)
[14:38:26.903]     at module.exports (/vercel/path1/node_modules/webpack/lib/util/createHash.js:135:53)
[14:38:26.903]     at NormalModule._initBuildHash (/vercel/path1/node_modules/webpack/lib/NormalModule.js:417:16)
[14:38:26.903]     at handleParseError (/vercel/path1/node_modules/webpack/lib/NormalModule.js:471:10)
[14:38:26.903]     at /vercel/path1/node_modules/webpack/lib/NormalModule.js:503:5
[14:38:26.904]     at /vercel/path1/node_modules/webpack/lib/NormalModule.js:358:12
[14:38:26.904]     at /vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:373:3
[14:38:26.904]     at iterateNormalLoaders (/vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
[14:38:26.904]     at iterateNormalLoaders (/vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
[14:38:26.906]     at /vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:236:3
[14:38:26.906]     at context.callback (/vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
[14:38:26.906]     at /vercel/path1/node_modules/babel-loader/lib/index.js:44:71
[14:38:26.932] Error: Command "npm run build" exited with 1

La parte que marca como error es la siguiente:

[14:38:26.903] Error: error:0308010C:digital envelope routines::unsupported
[14:38:26.903]     at new Hash (node:internal/crypto/hash:71:19)
[14:38:26.903]     at Object.createHash (node:crypto:133:10)
[14:38:26.903]     at module.exports (/vercel/path1/node_modules/webpack/lib/util/createHash.js:135:53)
[14:38:26.903]     at NormalModule._initBuildHash (/vercel/path1/node_modules/webpack/lib/NormalModule.js:417:16)
[14:38:26.903]     at handleParseError (/vercel/path1/node_modules/webpack/lib/NormalModule.js:471:10)
[14:38:26.903]     at /vercel/path1/node_modules/webpack/lib/NormalModule.js:503:5
[14:38:26.904]     at /vercel/path1/node_modules/webpack/lib/NormalModule.js:358:12
[14:38:26.904]     at /vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:373:3
[14:38:26.904]     at iterateNormalLoaders (/vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
[14:38:26.904]     at iterateNormalLoaders (/vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
[14:38:26.906]     at /vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:236:3
[14:38:26.906]     at context.callback (/vercel/path1/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
[14:38:26.906]     at /vercel/path1/node_modules/babel-loader/lib/index.js:44:71
[14:38:26.932] Error: Command "npm run build" exited with 1

En otras palabras, surgen los siguientes errores:

[14:38:26.903] Error: error:0308010C:digital envelope routines::unsupported
[14:38:26.932] Error: Command "npm run build" exited with 1

Nota: Ya intenté soluciones comunes reinstalar Node, actualizarlo, agregar "--openssl-legacy-provider".

Espero puedan ayudarme...

1 respuesta 1

1

Hola Daniel y a todos los que hayan tenido este problema. En base a la info que encontré en el foro de Frontity lo que hice fue modificar en el archivo package.json la versión de la engine de node a "16.3.0". En mi caso esa sección quedó así:

"engines": {
"node": "16.13.0",
"npm": ">=6.0.0" 
},

Recomiendo borrar la carpeta build y node_modules y luego correr los comandos:

npm install
npx frontity build

Luego de chequear que funciona en mi entorno local hice el push al repositorio y logré que el build en Vercel se ejecute correctamente.

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.