代码之家  ›  专栏  ›  技术社区  ›  Fractal

招摇:是“无法呈现此组件,请查看控制台”错误消息还是可以忽略

  •  9
  • Fractal  · 技术社区  · 7 年前

    '😱 Could not render this component, see the console' 
    

    (如第一幅图所示)是一条错误消息,或者可以忽略它(或者可能是一条包含很多内容的警告,因此并不总是适用?)。我正在测试上传一个文件(如第一张图所示)。图1下面的代码示例中显示了被点击的代码(与此帖子相对应的nodejs javascript)。非常简单,但一旦执行第23行,就会出现“无法呈现”消息。然而,“你好,世界!”确实会大张旗鼓地展示出来。我在网上四处寻找这条消息的含义,但唯一关于这条消息的帖子似乎并没有询问这条消息,而是在swagger的“服务器响应”部分中出现了一条错误消息。

    enter image description here

    //POST 
    function uploadAzureFile(req, res, next) {
    
      res.json('Hello World');
      // res.status(200).send('OK');
    
    }
    

    ======回应海伦========

    ======== ========

    找到有关卷曲的信息 here .我该如何访问swagger。curl的yaml?

    C:\swagger\curl>curl -I "http://localhost:1337/swagger.yaml"
    HTTP/1.1 404 Not Found
    X-Powered-By: Express
    X-Content-Type-Options: nosniff
    Content-Type: text/html; charset=utf-8
    Content-Length: 26
    Date: Sun, 06 Aug 2017 19:33:37 GMT
    Connection: keep-alive
    
    C:\swagger\curl>curl -I "http://localhost:1337/"
    HTTP/1.1 200 OK
    X-Powered-By: Express
    Content-Type: text/html; charset=utf-8
    Content-Length: 30
    ETag: W/"4z-8nd23698"
    Date: Sun, 06 Aug 2017 19:35:50 GMT
    Connection: keep-alive
    
    2 回复  |  直到 7 年前
        1
  •  7
  •   Helen    4 年前

    未渲染cURL命令

    this bug 这影响了cURL命令的显示 multipart/* 请求。这个bug是 2017年8月。请使用最新版本。

    到问题发出时,请求已实际发送,您可以在“服务器响应”>“详细信息”>“响应正文”下看到您的“Hello World”响应。

    参数 content

    您可能还会在参数中看到“无法渲染”错误 所容纳之物 .这是一个 different issue 那是

    其他地方的“未呈现内容”错误

    可能是另一个bug。在GitHub上的Swagger UI存储库中打开一个问题:
    https://github.com/swagger-api/swagger-ui/issues

        2
  •  1
  •   Dharman chazomaticus    3 年前

    type: "number" 从我的dto

    @ApiProperty({
        description: "Agents Array",
        isArray: true,
        type: "number"
    })
    @IsOptional()
    agents?: number[];