首页 > 解决方案 > UnhandledPromiseRejectionWarning: AggregateError: Issuer.discover() 失败。[auth0] [express] [openid-connect]

问题描述

我运行了这个示例应用程序的本地实例:here并遇到了一个我目前找不到解决方案的错误。

[01-Login]$ npm start

> auth0-express-webapp-sample@ start /mnt/ALPHA/Projects/auth0-express-webapp-sample/01-Login
> node server.js

Using 'form_post' for response_mode may cause issues for you logging in over http, see https://github.com/auth0/express-openid-connect/blob/master/FAQ.md
Listening on http://localhost:3000
(node:8779) UnhandledPromiseRejectionWarning: AggregateError: Issuer.discover() failed.
    RequestError: write EPROTO 140236193597312:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
    RequestError: write EPROTO 140236193597312:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
    at Function.discover (/mnt/ALPHA/Projects/auth0-express-webapp-sample/01-Login/node_modules/openid-client/lib/issuer.js:265:17)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8779) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8779) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

从外观上看,我需要在示例中的异步函数上使用 Promise 解析器

尽管我在不同版本的节点(稳定/最新甚至 13.x)上尝试了这个示例并且遇到了同样的问题。一些见解可能会有所帮助!谢谢你

标签: javascriptnode.jsexpressopenid-connectauth0

解决方案


推荐阅读