#firebase
#firebase
Вопрос:
мое приложение firebase показывает приложение только на localhost. Я успешно инициализировал и развернул приложение и когда и хочу показать его здесьhttps://techmatrixzeiterfassung.firebaseapp.com / оно показывает только пустую страницу. Я уже заменил index.html которое firebase заменяет на исходное
Это мой файл firebase.json
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
Комментарии:
1. Можете ли вы предоставить дополнительную информацию? Похоже, это должно было сработать.
Ответ №1:
Когда я открываю инструменты разработки в Chrome, я вижу ваш код.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link href="https://fonts.googleapis.com/icon?family=Material Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<title>Techmatrix Zeiterfassung</title>
</head>
<body>
<!-- This script adds the Roboto font to our project. For more detail go to this site: http://www.google.com/fonts#UsePlace:use/Collection:Roboto:400,300,500 -->
<script>
var WebFontConfig = {
google: { families: [ 'Roboto:400,300,500:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http')
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
</body>
</html>
На самом деле в индексе нет HTML-кода, который отображался бы в браузере. Я добавил div из dev tools, и он появился, как ожидалось
В консоли отображается ошибка:
/%PUBLIC_URL%/favicon.png:1 Не удалось загрузить ресурс: сервер ответил со статусом 400 ()
Возможно, вы ожидали увидеть значок на экране?