【问题标题】:heroku application error at=error code=H10 desc="App crashed" method=GET path="/"heroku 应用程序错误 at=error code=H10 desc="App crashed" method=GET path="/"
【发布时间】:2020-10-21 18:57:43
【问题描述】:

我已经使用 shopify api 创建了一个 react ecom 应用程序,该应用程序在本地工作并且构建已成功部署,但我无法在线查看我的应用程序。这是我的 github 仓库https://github.com/lizhavird/shopify-react-app

这是我的heroku日志:

2020-07-01T10:29:56.615981+00:00 heroku[web.1]: State changed from crashed to starting
2020-07-01T10:30:07.175132+00:00 heroku[web.1]: Starting process with command `node ./src/index.js`
2020-07-01T10:30:08.919146+00:00 app[web.1]: /app/src/index.js:1
2020-07-01T10:30:08.919158+00:00 app[web.1]: import React from 'react';
2020-07-01T10:30:08.919161+00:00 app[web.1]: ^^^^^
2020-07-01T10:30:08.919162+00:00 app[web.1]: 
2020-07-01T10:30:08.919163+00:00 app[web.1]: SyntaxError: Unexpected identifier
2020-07-01T10:30:08.919163+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:721:23)
2020-07-01T10:30:08.919164+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2020-07-01T10:30:08.919164+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2020-07-01T10:30:08.919164+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2020-07-01T10:30:08.919165+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2020-07-01T10:30:08.919165+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
2020-07-01T10:30:08.919166+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2020-07-01T10:30:08.919166+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2020-07-01T10:30:08.948836+00:00 heroku[web.1]: Process exited with status 1
2020-07-01T10:30:08.981678+00:00 heroku[web.1]: State changed from starting to crashed
2020-07-01T10:30:09.000000+00:00 app[api]: Build succeeded
2020-07-01T10:30:31.948773+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=shopify-ecom-react-app.herokuapp.com request_id=9ae149f3-e6e5-4b74-bc3f-67bea169f9d2 fwd="23.243.87.63" dyno= connect= service= status=503 bytes= protocol=https

【问题讨论】:

    标签: reactjs heroku


    【解决方案1】:

    错误告诉您import 关键字不是有效的语法。那是因为import 是 ES 模块功能的一部分,在您的 Node (v10) 版本中不可用。

    将 Create React Apps 部署到 Heroku 的推荐方法是使用 CRA Heroku Buildpack

    【讨论】:

      猜你喜欢
      • 2018-04-09
      • 1970-01-01
      • 2015-03-01
      • 2013-03-30
      • 2019-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-21
      相关资源
      最近更新 更多