-
Preliminary Checks
DescriptionWhen I run the gatsby build or the gatsby develop, errors arrives. ERROR
UNHANDLED REJECTION error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
- hash:67 new Hash
node:internal/crypto/hash:67:19
- node:crypto:130 Object.createHash
node:crypto:130:10
- createHash.js:155 BulkUpdateDecorator.hashFactory
[01fauna_netlify_gatsby]/[webpack]/lib/util/createHash.js:155:18
- createHash.js:55 BulkUpdateDecorator.update
[01fauna_netlify_gatsby]/[webpack]/lib/util/createHash.js:55:51
- DefinePlugin.js:568
[01fauna_netlify_gatsby]/[webpack]/lib/DefinePlugin.js:568:16
- Array.forEach
- DefinePlugin.js:564 walkDefinitionsForValues
[01fauna_netlify_gatsby]/[webpack]/lib/DefinePlugin.js:564:31
- DefinePlugin.js:591
[01fauna_netlify_gatsby]/[webpack]/lib/DefinePlugin.js:591:5
- Hook.js:14 Hook.CALL_DELEGATE [as _call]
[01fauna_netlify_gatsby]/[tapable]/lib/Hook.js:14:14
- Compiler.js:1053 Compiler.newCompilation
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:1053:26
- Compiler.js:1097
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:1097:29
- Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
[01fauna_netlify_gatsby]/[tapable]/lib/Hook.js:18:14
- Compiler.js:1092 Compiler.compile
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:1092:28
- Compiler.js:517
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:517:12
not finished onPreBootstrap - 3.111s
not finished Compiling Gatsby Functions - 3.104s On gatsby develop, errors arrive like this:
Reproduction Linkhttps://github.com/gatsby/gatsby-starter-hello-world Steps to Reproduce
Expected ResultIt should be successful. Actual Result ERROR
UNHANDLED REJECTION error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported
- hash:67 new Hash
node:internal/crypto/hash:67:19
- node:crypto:130 Object.createHash
node:crypto:130:10
- createHash.js:155 BulkUpdateDecorator.hashFactory
[01fauna_netlify_gatsby]/[webpack]/lib/util/createHash.js:155:18
- createHash.js:55 BulkUpdateDecorator.update
[01fauna_netlify_gatsby]/[webpack]/lib/util/createHash.js:55:51
- DefinePlugin.js:568
[01fauna_netlify_gatsby]/[webpack]/lib/DefinePlugin.js:568:16
- Array.forEach
- DefinePlugin.js:564 walkDefinitionsForValues
[01fauna_netlify_gatsby]/[webpack]/lib/DefinePlugin.js:564:31
- DefinePlugin.js:591
[01fauna_netlify_gatsby]/[webpack]/lib/DefinePlugin.js:591:5
- Hook.js:14 Hook.CALL_DELEGATE [as _call]
[01fauna_netlify_gatsby]/[tapable]/lib/Hook.js:14:14
- Compiler.js:1053 Compiler.newCompilation
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:1053:26
- Compiler.js:1097
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:1097:29
- Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
[01fauna_netlify_gatsby]/[tapable]/lib/Hook.js:18:14
- Compiler.js:1092 Compiler.compile
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:1092:28
- Compiler.js:517
[01fauna_netlify_gatsby]/[webpack]/lib/Compiler.js:517:12
not finished onPreBootstrap - 3.111s
not finished Compiling Gatsby Functions - 3.104s EnvironmentSystem:
OS: Windows 10 10.0.19042
CPU: (4) x64 Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz
Binaries:
Node: 17.0.1 - E:\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.1.1 - E:\nodejs\npm.CMD
Languages:
Python: 3.10.0 - /c/Python310/python
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (95.0.1020.30)
npmGlobalPackages:
gatsby-cli: 3.14.0 Config FlagsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 14 replies
-
Hi! Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it. If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look. Thanks for using Gatsby! 💜 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the nice response. 😊 I previously upgraded from Node 7 to Node 17. To install dependencies run on the root directory of the repo.
And then run,
|
Beta Was this translation helpful? Give feedback.
-
This is because you are using Node version 17. Workaround: Invoke node manually and instruct it to use the legacy openssl provider like so:
More info at https://stackoverflow.com/questions/69665222/node-17-0-1-causes-some-error-digital-envelope-routinesunsupported |
Beta Was this translation helpful? Give feedback.
-
When I tried, the error appeared, I have installed node_modules installed and gatsby is presented on the .bin folder. basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1025:15)
at Module._compile (node:internal/modules/cjs/loader:1059:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Node.js v17.0.1 |
Beta Was this translation helpful? Give feedback.
-
Please try Node.js v16 or Node.js >= 14.15.0 |
Beta Was this translation helpful? Give feedback.
-
Full answer https://stackoverflow.com/a/69665354/2124535
|
Beta Was this translation helpful? Give feedback.
-
Are there any updates on this issue? Node.js 18 is now the LTS version, yet Gatsby cannot be built with that version forcing many sites to work with v16. |
Beta Was this translation helpful? Give feedback.
-
And then got an error:
|
Beta Was this translation helpful? Give feedback.
-
I seem to have found something which might help. I typically use Node.js through the FNM version manager or via Homebrew. When I install Node.js 18 from Homebrew using the However, if I install Node.js 18 from FNM using the So, I dug deeper and discovered that Homebrew-installed Node.js still uses the older OpenSSL version. You can find the following dependencies by running Homebrew: {
node: '18.12.1',
v8: '10.2.154.15-node.12',
uv: '1.44.2',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.18.1',
modules: '108',
nghttp2: '1.50.0',
napi: '8',
llhttp: '6.0.10',
openssl: '1.1.1s',
cldr: '41.0',
icu: '71.1',
tz: '2022a',
unicode: '14.0'
} FNM: {
node: '18.12.1',
v8: '10.2.154.15-node.12',
uv: '1.43.0',
zlib: '1.2.11',
brotli: '1.0.9',
ares: '1.18.1',
modules: '108',
nghttp2: '1.47.0',
napi: '8',
llhttp: '6.0.10',
openssl: '3.0.7+quic',
cldr: '41.0',
icu: '71.1',
tz: '2022b',
unicode: '14.0',
ngtcp2: '0.8.1',
nghttp3: '0.7.0'
} My suspicion is that Gatsby 5 + Node.js 18 + OpenSSL 1.1 is fine, but Gatsby 5 + Node.js 18 + OpenSSL 3.0 is not. It would make sense, given the workaround flag How about you, @mockee — can you or anyone else confirm these? Should we also raise a new issue with the Gatsby maintainers? |
Beta Was this translation helpful? Give feedback.
-
I am having the same error migrating from Gatsby version 3 to 5. Following the two migration documentations (V3 to V4 and V4 to V5) I fail to see any mention of that error. In my case, I am using a Windows machine with WSL. The error appeared after following all these migration steps and executing From a few searches online (like this Stackoverflow.com), I suspect it is caused by the version of NodeJS. The accepted answer mentions: Here is a snippet of my package.json
|
Beta Was this translation helpful? Give feedback.
-
We're on Node 18 and we continue to get the same error. What can we try? |
Beta Was this translation helpful? Give feedback.
-
Node 18, Gatsby 5, same issue. We would love to to get this solved so we can start using Gatsby 5. |
Beta Was this translation helpful? Give feedback.
-
Hello guys! ERROR #98123 WEBPACK Generating SSR bundle failed Unexpected token (48:9) File: node_modules/htmlparser2/lib/esm/index.js:48:9 not finished Building HTML renderer - 18.060s error Command failed with exit code 1. Can anyone help what should I do? |
Beta Was this translation helpful? Give feedback.
-
Am I missing something? 😅 |
Beta Was this translation helpful? Give feedback.
-
When is this planned to be tackled and fixed? This is an issue in all the current Node supported versions: >18. 16 went out of security support 4 months ago... I'm running Gatsby with [email protected] and this is still an issue... For more context this webpack issue might help: webpack/webpack#14532 I think this point from @nikoheikkila above is really insightful:
|
Beta Was this translation helpful? Give feedback.
Please try Node.js v16 or Node.js >= 14.15.0