我在将 Angular 应用程序部署到 github 页面时遇到问题

乌尔坦·卡恩斯

该网站在 Firefox 中运行良好,但在 chrome 中查看时,我收到以下错误消息

styles.7c3fd40….css:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
runtime.2620947….js:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
polyfills.bebee6a….js:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
main.700130d….js:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
%3Cultan-kearns%3E.g…earns/favicon.ico:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED

抱歉,如果这是一个愚蠢的问题,我还没有过多地使用带有 angular 的 github 页面。

有问题的网站是:https : //ultan-kearns.github.io/ultankearns/

我曾尝试在 Opera 和 Edge 中运行该站点,但遇到了相同的错误,并且我多次尝试重新部署该站点,但我陷入了困境。提前感谢大家。

维维克多西

请检查您base hrefindex.html文件:

<base href="https://<ultan-kearns>.github.io/ultankearns/">

应该是这样的:

<base href="https://ultan-kearns.github.io/ultankearns/">

这个代码块应该在你的 head 标签内,

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Oswald&display=swap" rel="stylesheet">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>

你的 html 文件看起来应该是这样的:

<!doctype html>
    <head>
        <meta charset="utf-8">
        <title>Website</title>
        <base href="https://ultan-kearns.github.io/ultankearns/">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="icon" type="image/x-icon" href="favicon.ico">
        <link rel="stylesheet" href="styles.7c3fd40d0bab5f41ea0e.css">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
        <link href="https://fonts.googleapis.com/css?family=Oswald&display=swap" rel="stylesheet">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    </head>
    <body>
        <app-root></app-root>
        <script type="text/javascript" src="runtime.26209474bfa8dc87a77c.js"></script>
        <script type="text/javascript" src="polyfills.bebee6a5ef0ece001bc6.js"></script>
        <script type="text/javascript" src="main.700130d31064f7530e56.js"></script>
    </body>
</html>

请将此与您的进行比较index.html并将其替换为您的并将其上传到 gitgub 它将起作用。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

404将Angular 6应用程序部署到github页面时

使用 angular-cli-ghpages 将 Angular 应用程序部署到 Github 页面?

将angular 2应用程序部署到github页面-失败

将 React 应用程序部署到 github 页面

将Angular应用程序部署到Heroku时出错

为什么在将Symfony 4应用程序部署到Heroku时遇到问题?

在我的 Angular 应用程序中对 JokeAPI 的 API 调用进行观察/订阅时遇到问题

使用GitHub Actions将Angular应用程序部署到beantalk

部署到 Github 页面的 Angular 应用程序未初始化?

将我的React应用程序部署到github页面后,我看到404

如何创建工作流以将 React & Gatsby 应用程序部署到 Github 页面?

如何将Ionic 4应用程序部署到Github页面?

尝试将 React 应用程序部署到 *.github.io 页面;得到“意外的令牌:'<'”

将Angular 5应用程序部署到Heroku时出现问题

我如何在 Github 页面上将 Angular 应用程序部署为 https://USERNAME.github.io

为什么在尝试将React应用程序部署到GitHub Pages时出现错误?

将ASP.net Angular应用程序部署到IIS的问题

在将 Angular 应用程序部署到 heroku 和运行 ng serve 时出错?

将我的Angular应用程序部署在GitHub页面上,但控制台中的网站出现错误

将 Angular 7 部署到 github 页面

将反应应用程序部署到 github 页面正在发布一个空白页面

如何将一个简单的 React 应用程序作为“用户页面”部署到 Github Pages?

将Angular 2应用程序部署到Azure

将 Angular 2 应用程序部署到 Azure

将 angular-universal 应用程序部署到 heroku

我在将数据导入到asp.net页面时遇到问题,当我打开页面时,我发现所有文件都为空

将PHP应用程序部署到Elastic Beanstalk的问题

将 tailwindcss 应用到我的 React 应用程序后,我在执行“纱线启动”时遇到问题

将应用程序部署到Windows Phone时出错