Skip to content

项目启动后请求网页地址无响应,迫于 raw.githubusercontent.com 无法访问 #8

Description

前言

由于一些不可描述的原因,在不连接梯子的情况下,raw.githubusercontent.com 无法访问,这导致 starter 项目无法启动。

表现情况

执行 npm run dev 之后,提示 UnhandledPromiseRejectionWarning: Error: getaddrinfo ENOENT raw.githubusercontent.com,请求网页地址无响应

下图为部分日志信息

启动日志

网页无响应

原因分析

查看 app.js 可发现,只有 await 后的 promiseresolved,即 axios.get 后面的地址可以正常访问时,才可以 res.render 页面

image

解决方案

  • 配置 host

    151.101.76.133 raw.githubusercontent.com

  • 使用本地 mock 资源文件

    请参考 527c893

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions