解构如何运用的解构--报错 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))

简介: 解构如何运用的解构--报错 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
let aa={ error_code: 0, reason: "插入数据成功" };
//如何拿到  error_code 和  reason  的值
let { error_code, reason } = aa;
  console.log(error_code,reason); // 输出0 和 插入数据成功


对于报错throw new Typ   eError('Router.use() requires a middleware function but got a ' + gettype(fn))

1425695-20190531003440743-1748744182.jpg

是因为你没有在最后某个文件中写


module.exports = router;

相关文章
|
2月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
140 13
|
2月前
|
缓存 开发工具 C++
VS Code调试Function报错|无法加载Diagnostics.Abstractions怎么办?
在调试 Azure Function 时,可能出现 “Could not load file or assembly 'Microsoft.Extensions.Diagnostics.Abstractions, Version=8.0.0.0'” 错误,导致主机启动失败。本文详细解析该依赖加载错误的成因,并提供基于不同安装方式(NPM 或 MSI)的解决方案,涵盖重装 Core Tools、清理缓存、检查 .NET SDK 版本等操作步骤,同时提供日志排查与 Docker 容器化替代方案,帮助开发者快速恢复本地调试流程。
124 0
|
3月前
|
网络协议 API 网络安全
【Azure Function App】发现部分请求Function App遇见 403.72 报错(请求Body>100KB)
在调用Azure Function的HTTP Trigger时,发送POST请求偶尔出现403错误,且响应为空、Header信息少。经排查发现,当请求Body大于100KB时会触发403.72错误,原因是启用了“Client Certificate mode”为“Optional Interactive User”。解决方法是将该模式设置为“Ignore”。由于TLS重新协商机制限制,大请求体无法正常处理,导致此问题。
122 1
|
9月前
|
Java Windows
【Azure Function】部署Java Function失败:报错deploy [ERROR] Status code 401和警告 'China North 3' may not be a valid region
1:deploy [ERROR] Status code 401, (empty body). 2: China North 3 may not be a valid region,please refer to https://aka.ms/maven_function_configuration#supported-regions for values. 3:  <azure.functions.maven.plugin.version>1.36.0</azure.functions.maven.plugin.version>
132 11
|
12月前
|
Linux Python
【Azure Function】Python Function部署到Azure后报错No module named '_cffi_backend'
ERROR: Error: No module named '_cffi_backend', Cannot find module. Please check the requirements.txt file for the missing module.
214 2
|
12月前
构造函数(function)可以使用 new 生成实例,箭头函数可以吗
构造函数使用 `new` 关键字可以生成实例对象,而箭头函数则不能用作构造函数,因为它没有自己的 `this` 上下文,使用 `new` 调用会抛出错误。
|
缓存
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
131 0
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
|
存储 网络安全 数据中心
【Azure 应用服务】Function App / App Service 连接 Blob 报错
【Azure 应用服务】Function App / App Service 连接 Blob 报错
|
JavaScript 前端开发 C++
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
125 0

热门文章

最新文章