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 running freshly created ignite app on the web (error:0308010C:digital envelope routines::unsupported) #2410

Closed
P451M opened this issue Mar 30, 2023 · 7 comments · Fixed by #2377
Labels

Comments

@P451M
Copy link

P451M commented Mar 30, 2023

Describe the bug

Hi, I'm unable to run my freshly created ignite app on the web. I get the following terminal output for yarn:expo start followed by pressing w to run the app on the web:

node:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/home/paul/Repos/testApp/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/paul/Repos/testApp/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseError (/home/paul/Repos/testApp/node_modules/webpack/lib/NormalModule.js:471:10)
at /home/paul/Repos/testApp/node_modules/webpack/lib/NormalModule.js:503:5
at /home/paul/Repos/testApp/node_modules/webpack/lib/NormalModule.js:358:12
at /home/paul/Repos/testApp/node_modules/loader-runner/lib/LoaderRunner.js:373:3
at iterateNormalLoaders (/home/paul/Repos/testApp/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
at Array. (/home/paul/Repos/testApp/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
at Storage.finished (/home/paul/Repos/testApp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
at /home/paul/Repos/testApp/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
at /home/paul/Repos/testApp/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

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

Additional information:
I run into the same error when using npm. npm/yarn audit fix (--force) doesn't help.
The suggested solutions in this stackoverflow post (downgrading Node or enabling legacy OpenSSL provider) both seem to cause security issues.

Thanks in advance and all the best,
Paul

Ignite version

8.6.0

Additional info

Need to install the following packages:
ignite-cli@8.6.0
Ok to proceed? (y)
System
platform linux
arch x64
cpu 4 cores Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
directory testApp /home/paul/Repos/testApp

JavaScript (and globally-installed packages)
node 18.15.0 /home/paul/.nvm/versions/node/v18.15.0/bin/node
npm 9.5.0 /home/paul/.nvm/versions/node/v18.15.0/bin/npm
corepack 0.15.3
npm 9.5.0
tslint 6.1.3
typescript-formatter 7.2.2
typescript 4.9.5
yarn 1.22.19 /usr/bin/yarn
neovim 4.10.1
tree-sitter-cli 0.20.7
pnpm 8.1.0 /usr/bin/pnpm

expo 47.0.13 managed

Ignite
ignite-cli 8.6.0 /home/paul/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite
ignite src build /home/paul/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build

Android
java 19.0.2 /usr/bin/java
android home - /opt/android-sdk

Tools
git git version 2.39.2 /usr/bin/git

@P451M P451M added the bug label Mar 30, 2023
@joshuayoes
Copy link
Contributor

joshuayoes commented Mar 30, 2023

This can be resolved immediately by using Node 16. However, this is not a great long term path as Node 16 reaches EoL.

The issue is upstream in webpack, checkout some of the solutions in this issue on the Webpack repo: webpack/webpack#14532

We depend on Webpack 4 for Expo Web. Webpack 4 depends on a node:crypto algorithm that uses OpenSSL which is insecure and was changed in Node 17+. Some of the solutions in the previous issue involve either restoring previous behavior or patching Webpack 4 to use a different algorithm.

@frankcalise
Copy link
Contributor

Node 18 should be fine (I'm on 18.11.0), I've heard of this error before but don't know why it doesn't always show up.

Does this unblock you at all?

export NODE_OPTIONS=--openssl-legacy-provider
yarn expo:start

@P451M
Copy link
Author

P451M commented Apr 1, 2023

Does this unblock you at all?

export NODE_OPTIONS=--openssl-legacy-provider
yarn expo:start

Yes, that's what I'm doing for now.

@berkerdemirer
Copy link

Having the same issue with node v18

@frankcalise
Copy link
Contributor

@P451M do you want to see if this goes away with the latest that's awaiting review? #2377

@joshuayoes
Copy link
Contributor

@P451M do you want to see if this goes away with the latest that's awaiting review? #2377

I was able to get web working with this PR

@frankcalise frankcalise linked a pull request Apr 26, 2023 that will close this issue
7 tasks
@joshuayoes
Copy link
Contributor

@P451M try this out using npx ignite-cli@8.8.0-beta.1 new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants