[英]Discord login on my website is not working. Why?
我想在网站上实现 Discord 登录。 但我有几个问题。 当我在终端中使用node oauth.js
启动应用程序时,没有弹出错误。 但是,当我在 Discord 网站上单击授权时,会弹出以下错误:
TypeError: fetch is not a function
at ...\oauth.js:49:5
at Layer.handle [as handle_request] (...\node_modules\express\lib\router\layer.js:95:5)
at next (...\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (...\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (...\node_modules\express\lib\router\layer.js:95:5)
at ...\node_modules\express\lib\router\index.js:281:22
at Function.process_params (...\node_modules\express\lib\router\index.js:335:12)
at next (...\node_modules\express\lib\router\index.js:275:10)
at ...\node_modules\body-parser\lib\read.js:130:5
at invokeCallback (...\node_modules\raw-body\index.js:224:16)
我在我的代码中找不到错误...这与fetch
有任何想法吗?
通过查看小提琴,除了您格式化fetch
导入的方式之外,我看不出任何问题。
const fetch = require('node-fetch');
尝试类似的东西而不是导入它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.