Трафарет JS + Facebook Instant Game, приложение - root не рендеринг - PullRequest
0 голосов
/ 10 февраля 2020

Я пытаюсь настроить свою мгновенную игру на Facebook.

Я следовал https://developers.facebook.com/docs/games/instant-games/test-publish-share, чтобы провести локальное тестирование, а затем развернуть в производство.

При тестировании все отлично работает Тем не менее, на производстве ничего не появляется (черный экран), когда я открываю игру. <app-root> не отображается, конструктор app-home не вызывается и занимает 0x0 пикселей.

Это мой индекс. html

<!--
  Copyright (c) 2017-present, Facebook, Inc.
  All rights reserved.
  This source code is licensed under the license found in the
  LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html>

<head>

  <meta charset="utf-8">
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="full-screen" content="yes" />
  <meta name="screen-orientation" content="portrait" />
  <meta name="viewport" content="user-scalable=no" />

  <script type="module" src="/build/app.esm.js"></script>
  <script nomodule src="/build/app.js"></script>
  <link href="/build/app.css" rel="stylesheet">
  <link rel="apple-touch-icon" sizes="180x180" href="/assets/icon/apple-touch-icon.png">
  <link rel="icon" type="image/x-icon" href="/assets/icon/favicon.ico">
  <link rel="manifest" href="/manifest.json">
</head>

<body>
  <script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>
  <script type="text/javascript">

    const assets = [
      'img/asset1.png',
      'img/asset2.png',
      'img/asset3.png',
      'img/asset4.png'
    ];

    window.onload = function () {

      // When the window loads, start to initialize the SDK
      FBInstant.initializeAsync().then(function () {

        // We can start to load assets
        for (let i in assets) {
          // When preloading assets, make sure to report the progress
          FBInstant.setLoadingProgress(i / assets.length * 100);
        }

        // Now that assets are loaded, call startGameAsync
        FBInstant.startGameAsync().then(() => console.log("initialized"));
      });
    };
  </script>

  <app-root></app-root>

</body>

</html>

'initialized' is напечатано в консоли, когда я открываю игру. Здесь есть две ошибки (которые могут иметь отношение к моей ошибке) Журналы консоли

Ошибка 404 (ресурс не найден) - это файл. js, который Я проверил, был включен в ZIP-файл, который я загрузил.

Это то, что я вижу, когда я проверяю элемент в игре Проверять элемент

Кроме того, на мобильном телефоне, ничего не отображается (белый экран)

Любая помощь будет принята с благодарностью. Спасибо! :)

...