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

Build errors #484

Open
2color opened this issue Oct 27, 2022 · 1 comment
Open

Build errors #484

2color opened this issue Oct 27, 2022 · 1 comment
Labels
need/triage Needs initial labeling and prioritization

Comments

@2color
Copy link
Member

2color commented Oct 27, 2022

In recent PRs we got the follwing error:

12:53:21 PM 10/27/2022: ^
12:53:21 PM 10/27/2022: Error: error:0308010C:digital envelope routines::unsupported
12:53:21 PM 10/27/2022: at new Hash (node:internal/crypto/hash:71:19)
12:53:21 PM 10/27/2022: at Object.createHash (node:crypto:133:10)
12:53:21 PM 10/27/2022: at module.exports (/workspace/node_modules/webpack/lib/util/createHash.js:135:53)
12:53:21 PM 10/27/2022: at NormalModule._initBuildHash (/workspace/node_modules/webpack/lib/NormalModule.js:417:16)
12:53:21 PM 10/27/2022: at handleParseError (/workspace/node_modules/webpack/lib/NormalModule.js:471:10)
12:53:21 PM 10/27/2022: at /workspace/node_modules/webpack/lib/NormalModule.js:503:5
12:53:21 PM 10/27/2022: at /workspace/node_modules/webpack/lib/NormalModule.js:358:12
12:53:21 PM 10/27/2022: at /workspace/node_modules/loader-runner/lib/LoaderRunner.js:373:3
12:53:21 PM 10/27/2022: at iterateNormalLoaders (/workspace/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
12:53:21 PM 10/27/2022: at iterateNormalLoaders (/workspace/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
12:53:21 PM 10/27/2022: at /workspace/node_modules/loader-runner/lib/LoaderRunner.js:236:3
12:53:21 PM 10/27/2022: at context.callback (/workspace/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
12:53:21 PM 10/27/2022: at /workspace/node_modules/cache-loader/dist/index.js:134:7
12:53:21 PM 10/27/2022: at /workspace/node_modules/graceful-fs/graceful-fs.js:61:14
12:53:21 PM 10/27/2022: at FSReqCallback.oncomplete (node:fs:197:23) {
12:53:21 PM 10/27/2022: opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
12:53:21 PM 10/27/2022: library: 'digital envelope routines',
12:53:21 PM 10/27/2022: reason: 'unsupported',
12:53:21 PM 10/27/2022: code: 'ERR_OSSL_EVP_UNSUPPORTED'
12:53:21 PM 10/27/2022: }
12:53:21 PM 10/27/2022: Node.js v18.12.0
12:53:45 PM 10/27/2022: Error occured during the build.

I haven't been able to find the exact root cause, but since we were using the node:lts Docker build image, this error may stem from a recent version bump of node.

This likely stems from Webpack using a specific hash function that is linked to OpenSSL.

I was able to resolve this by adding the following ENV var to the build:

NODE_OPTIONS=--openssl-legacy-provider

We should investigate how to better resolve this. Perhaps it's from some outdated dependencies in this repo that are using an old version of Webpack.

@2color 2color added the need/triage Needs initial labeling and prioritization label Oct 27, 2022
@markg85
Copy link
Contributor

markg85 commented Oct 7, 2023

I was stuck on this issue too.
I'm running the latest nodejs version (as of this moment, 20.8.0) and it gives me:

ℹ 「wds」: Project is running at http://0.0.0.0:8081/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/mark/GitProjects/ipfs-blog/src/.vuepress/public
ℹ 「wds」: 404s will fallback to /index.html
node:internal/crypto/hash:68
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

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

Now here's the kicker.
Installing this with npm imstall followed by an npm start gives me the above error.
But installing it with yarn install and then folowed by npm start magically works!

Yeah, no clue what is happening here.

Side note though, the dependencies of this project are getting very old by now. It should be updated. Which is troublesome as just bluntly updating all of it isn't working anymore (i tried).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants