You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(node:72) UnhandledPromiseRejectionWarning: TypeError: Pass phrase must be a string
at Object.createSecureContext (_tls_common.js:149:17)
at Server.setSecureContext (_tls_wrap.js:1331:27)
at Server (_tls_wrap.js:1186:8)
at new Server (https.js:70:3)
at Object.createServer (https.js:106:10)
at startEndpoint (/root/.npm/_npx/72/lib/node_modules/serve/bin/serve.js:208:11)
at /root/.npm/_npx/72/lib/node_modules/serve/bin/serve.js:451:3
serve --version
:12.0.1
node --version
:14.18.1
command:
serve -s build --ssl-cert ./site-cert.crt --ssl-key ./site-cert.key --ssl-pass ./site-cert-pass.txt
Error
Reason
serve/bin/serve.js
Line 211 in 30b0673
tl;dr:
fs.readFileSync
, when given no encoding options, returns aBuffer
. Buthttps.createServer
requirespassphrase
to be astring
.Node
fs
14.x docsNode
tls
14.x docsWhere
tls
is what is ultimately parses the cert options given tohttps.createServer
Recommendation - Merge #673
serve/bin/serve.js
Line 207 in 7893b3a
Suggestions(edit: both already implemented by preceding PR)'utf8'
, which is the default encoding for allfs
functions that don't default tonull
Notes
The text was updated successfully, but these errors were encountered: