質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Q&A

解決済

1回答

408閲覧

SkyWay Conference をHerokuで動かしたいがアプリケーションエラー発生

ygoto

総合スコア10

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

0グッド

0クリップ

投稿2020/08/12 02:10

編集2020/08/12 17:12

前提・実現したいこと

SkyWay ConferenceをHerokuにデプロイし、技術検証をしたかったのですが、デプロイ完了後にApplication errorになってしまいます。
このエラーを解消したいのですが、ログを見ても原因がわからないため、ご教授願いたいです。

デプロイファイルはこの手順で作成しました

発生している問題・エラーメッセージ

Heroku画面上

Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail

heroku logs

2020-08-12T01:35:38.374935+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=XXX request_id=890b5e7b-d82e-44d6-a3a1-f855b93ea81e fwd="106.72.36.193" dyno= connect= service= status=503 bytes= protocol=https 2020-08-12T01:35:38.754952+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=XXX request_id=599e073f-0c6b-4b4e-b38d-8a60618563f7 fwd="106.72.36.193" dyno= connect= service= status=503 bytes= protocol=https

デプロイ直後に下記エラー(ReferenceError: window is not defined)が発生し、解消方法がわからない状態です。
サポートにnode.js環境下では実行できないとありましたが、Heroku環境下で実行する方法はないのでしょうか。
webサービス初心者なので質問が安直で恐縮ですが、ご教授願いたいです。

2020-08-12T15:17:21.893432+00:00 heroku[web.1]: Starting process with command `node index.bundle.js` 2020-08-12T15:17:24.535440+00:00 heroku[web.1]: Process exited with status 1 2020-08-12T15:17:24.587888+00:00 heroku[web.1]: State changed from starting to crashed 2020-08-12T15:17:24.590391+00:00 heroku[web.1]: State changed from crashed to starting 2020-08-12T15:17:24.474946+00:00 app[web.1]: /app/index.bundle.js:1 2020-08-12T15:17:24.474995+00:00 app[web.1]: !function(e){function t(t){for(var n,o,c=t[0],s=t[1],l=t[2],f=0,d=[];f<c.length;f++)o=c[f],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&d.push(a[o][0]),a[o]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);d.length;)d.shift()();return i.push.apply(i,l||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],n=!0,c=1;c<r.length;c++){var s=r[c];0!==a[s]&&(n=!1)}n&&(i.splice(t--,1),e=o(o.s=r[0]))}return e}var n={},a={2:0},i=[];function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;i.push([34,0]),r()}([,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return c}));var n=r(0);const a=16,i={blue:"#005ece",lightblue:"#039be5",red:"#ff6673",gray:"#eee",white:"#fff",black:"#111"},o={moveBackground:n.d` 2020-08-12T15:17:24.475000+00:00 app[web.1]: 2020-08-12T15:17:24.475001+00:00 app[web.1]: 2020-08-12T15:17:24.475001+00:00 app[web.1]: ReferenceError: window is not defined 2020-08-12T15:17:24.475001+00:00 app[web.1]: at /app/index.bundle.js:1:1359 2020-08-12T15:17:24.475002+00:00 app[web.1]: at Object.<anonymous> (/app/index.bundle.js:1:1503) 2020-08-12T15:17:24.475002+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1137:30) 2020-08-12T15:17:24.475007+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10) 2020-08-12T15:17:24.475007+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:985:32) 2020-08-12T15:17:24.475007+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:878:14) 2020-08-12T15:17:24.475012+00:00 app[web.1]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) 2020-08-12T15:17:24.475012+00:00 app[web.1]: at internal/main/run_main_module.js:17:47

作成ファイル

手順通りに下記ファイルを作成し、デプロイしました。
また、Herokuを使用するにあたり、package.jsonProcfileが必要と調べてわかったので新たに作成しています。
全て作業フォルダ直下に配置しています。

ファイル構成

作業フォルダ -conf.bundle.js -conf.html -images -index.bundle.js -index.html -package.json -Procfile -vendor.bundle.js

package.jsonは空で作成

json

1{}

Procfileには下記を記載

web: node index.bundle.js

試したこと

Pushエラー回避のため、package.jsonとProcfileは新たに作成しました。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

下記phpファイルとconposer.jsonを作成してphpとしてアプリを認識させたところ、うまく起動しました。ありがとうございました。node .jsに関しては無知のまま挑戦してたので、勉強します。

(index.php)

php

1<?php include_once("index.html"); ?>

(composer.json)

json

1{}

投稿2020/08/13 01:13

編集2020/08/13 03:50
ygoto

総合スコア10

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問