简体   繁体   中英

There are erros when deployed to Heroku

My rails app uses react-rails and I deployed my project to Heroku. And it was finished successfully. But I can't connect the project on Heroku. It shows error page. So I have checked heroku logs.

2017-09-23T15:11:19.654651+00:00 app[web.1]: Started GET "/" for 31.200.230.123 at 2017-09-23 15:11:19 +0000
2017-09-23T15:11:19.710323+00:00 app[web.1]: Processing by DashboardsController#show as HTML
2017-09-23T15:11:20.013683+00:00 heroku[router]: at=info method=GET path="/" host=rockcms.herokuapp.com request_id=5c8bebb0-fc0b-4af3-8721-006a1f9829d1 fwd="31.200.230.123" dyno=web.1 connect=1ms service=366ms status=500 bytes=1733 protocol=https
2017-09-23T15:11:20.002369+00:00 app[web.1]: Completed 500 Internal Server Error in 292ms  
2017-09-23T15:11:20.008529+00:00 app[web.1]: ExecJS::ProgramError (ReferenceError: React is not defined):
2017-09-23T15:11:20.011167+00:00 app[web.1]: (execjs):35:12442
2017-09-23T15:11:20.011168+00:00 app[web.1]: (execjs):43:14

And I think,the error occurs because of react. I need correct advice. And if you need some information, I will show them.

Thanks!

Import these above the file where your react code resides

import React from "react"; 
import ReactDOM from "react-dom";

如上所述需要导入,或者需要在生产服务器上执行npm install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM