heroku应用程序错误at =错误代码= H10 desc =“应用程序崩溃”方法=获取路径=“ /”

时间:2020-07-01 10:37:59

标签: reactjs heroku

我已经用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

1 个答案:

答案 0 :(得分:0)

该错误告诉您import关键字无效的语法。这是因为import是ES模块功能的一部分,而您的Node(v10)版本中没有此功能。

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