在部署create-react-app到Heroku时出现应用程序错误的解决方法可能有很多种,具体解决方法取决于具体的错误原因。以下是一个可能的解决方案,其中包含一些常见的错误和代码示例:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
// ...
}
web: npm start
node_modules/
build/
$ git remote -v
origin https://github.com/your-username/your-repo.git (fetch)
origin https://github.com/your-username/your-repo.git (push)
$ heroku login
$ heroku create your-app-name
$ git push heroku master
$ heroku ps:scale web=1
$ heroku logs --tail
如果这些解决方法都不能解决问题,那么可能需要进一步检查应用程序的错误消息和代码以找到特定的问题所在。