Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: error:0308010C:digital envelope routines::unsupported #574

Open
1 of 3 tasks
yonas opened this issue Jun 30, 2023 · 7 comments
Open
1 of 3 tasks

Error: error:0308010C:digital envelope routines::unsupported #574

yonas opened this issue Jun 30, 2023 · 7 comments
Labels
a:bug Something isn't working

Comments

@yonas
Copy link

yonas commented Jun 30, 2023

Can the issue be reproduced with the latest available release? (y/n)

Which one is the environment gotify server is running in?

  • Docker
  • Linux machine
  • Windows machine
Docker startup command or config file here (please mask sensitive information)

$ yarn ; yarn install ; yarn build
...
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/home/yonas/git/server/ui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/yonas/git/server/ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/yonas/git/server/ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/home/yonas/git/server/ui/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/home/yonas/git/server/ui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:417:16)
    at /home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:452:10
    at /home/yonas/git/server/ui/node_modules/webpack/lib/NormalModule.js:323:13
    at /home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:367:11
    at /home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/yonas/git/server/ui/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /home/yonas/git/server/ui/node_modules/react-scripts/node_modules/babel-loader/lib/index.js:59:103 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

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

Ubuntu 23.04
gotify: 5cd2d54

@yonas yonas added the a:bug Something isn't working label Jun 30, 2023
@jmattheis
Copy link
Member

jmattheis commented Jun 30, 2023

The UI still uses an older react-scripts version which uses the legacy openssl provider. if you're Nodejs > 16, then you've to add this env variable, and then execute yarn build.

export NODE_OPTIONS=--openssl-legacy-provider

@yonas
Copy link
Author

yonas commented Jun 30, 2023

EDIT

@jmattheis Thanks, that worked!

@yonas
Copy link
Author

yonas commented Jun 30, 2023

I recommend that the build script detects the running node version and sets this environment variable on behalf of the user.

@jmattheis
Copy link
Member

Maybe, but it's probably better to remove the need for the legacy openssl version by updating the react-scripts dependency.

@yonas
Copy link
Author

yonas commented Jul 2, 2023

@jmattheis When updating react-scripts to ^5.0.1, I get this error:

$ yarn ; yarn install ; yarn build
...
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.

babel-preset-react-app is part of the create-react-app project, which
is not maintained anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
  
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
Failed to compile.

Loading PostCSS "postcss-normalize" plugin failed: Cannot find module 'postcss-normalize'
Require stack:
- /git/gotify/server/ui/node_modules/postcss-loader/dist/utils.js
- /git/gotify/server/ui/node_modules/postcss-loader/dist/index.js
- /git/gotify/server/ui/node_modules/postcss-loader/dist/cjs.js
- /git/gotify/server/ui/node_modules/loader-runner/lib/loadLoader.js
- /git/gotify/server/ui/node_modules/loader-runner/lib/LoaderRunner.js
- /git/gotify/server/ui/node_modules/webpack/lib/NormalModule.js
- /git/gotify/server/ui/node_modules/webpack-manifest-plugin/dist/index.js
- /git/gotify/server/ui/node_modules/react-scripts/config/webpack.config.js
- /git/gotify/server/ui/node_modules/react-scripts/scripts/build.js

(@/git/gotify/server/ui/node_modules/codemirror/lib/codemirror.css)


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

@jmattheis
Copy link
Member

Yeah, only updating react-scripts isn't enough, everything that depends on it must be updated too.

@shiraz27
Copy link

You can simply use node v16, try NVM for switching between versions easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug Something isn't working
Development

No branches or pull requests

3 participants