如何解决Heroku Build成功用于我的React应用程序,但是当我转到网站时,出现“应用程序错误”
将代码从主服务器推送到heroku之后,我可以看到构建成功,但是当我们实际转到部署成功构建的站点时,应用程序会引发错误。任何机构都可以帮助我知道为什么出现应用程序错误。
当我拖尾日志时,我可以在下面找到-
2020-10-11T18:43:41.000000+00:00 app[api]: Build succeeded
2020-10-11T18:43:42.873865+00:00 heroku[web.1]: Starting process with command `npm start`
2020-10-11T18:43:46.006173+00:00 app[web.1]:
2020-10-11T18:43:46.006198+00:00 app[web.1]: > myportfoliosite@0.1.0 start /app
2020-10-11T18:43:46.006198+00:00 app[web.1]: > react-scripts start
2020-10-11T18:43:46.006199+00:00 app[web.1]:
2020-10-11T18:43:49.419055+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.22.138/
2020-10-11T18:43:49.419568+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-10-11T18:43:49.419684+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-10-11T18:43:49.419841+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-10-11T18:43:49.420118+00:00 app[web.1]: Starting the development server...
2020-10-11T18:43:49.420119+00:00 app[web.1]:
2020-10-11T18:43:49.507004+00:00 heroku[web.1]: Process exited with status 0
2020-10-11T18:43:49.548170+00:00 heroku[web.1]: State changed from starting to crashed
2020-10-11T18:43:49.550937+00:00 heroku[web.1]: State changed from crashed to starting
2020-10-11T18:44:01.341243+00:00 heroku[web.1]: Starting process with command `npm start`
2020-10-11T18:44:04.397476+00:00 app[web.1]:
2020-10-11T18:44:04.397511+00:00 app[web.1]: > myportfoliosite@0.1.0 start /app
2020-10-11T18:44:04.397511+00:00 app[web.1]: > react-scripts start
2020-10-11T18:44:04.397511+00:00 app[web.1]:
2020-10-11T18:44:06.978790+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.146.242/
2020-10-11T18:44:06.979411+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-10-11T18:44:06.979554+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-10-11T18:44:06.979678+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-10-11T18:44:06.979966+00:00 app[web.1]: Starting the development server...
2020-10-11T18:44:06.979968+00:00 app[web.1]:
2020-10-11T18:44:07.118043+00:00 heroku[web.1]: Process exited with status 0
2020-10-11T18:44:07.163548+00:00 heroku[web.1]: State changed from starting to crashed
2020-10-11T18:44:09.831089+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=meghraj-portfolio.herokuapp.com request_id=92057baf-e407-4ebe-be37-fc750bd83a41 fwd="152.57.99.116" dyno= connect= service= status=503 bytes= protocol=https
2020-10-11T18:44:10.368807+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=meghraj-portfolio.herokuapp.com request_id=92f4eae5-55f0-4beb-a7d7-0aac78a9eb1d fwd="152.57.99.116" dyno= connect= service= status=503 bytes= protocol=https
不确定是什么原因导致应用程序崩溃。 以下是构建日志-
Counting objects: 100% (7/7),done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4),done.
Writing objects: 100% (4/4),462 bytes | 462.00 KiB/s,done.
Total 4 (delta 3),reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: USE_YARN_CACHE=true
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.19.0...
remote: Using default npm version: 6.14.8
remote: Resolving yarn version 1.22.x...
remote: Downloading and installing yarn (1.22.5)
remote: Installed yarn 1.22.5
remote:
remote: -----> Restoring cache
remote: - yarn cache
remote:
remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.22.5
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
remote: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
remote: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
remote: [4/4] Building fresh packages...
remote: Done in 22.22s.
remote:
remote: -----> Build
remote: Running build (yarn)
remote: yarn run v1.22.5
remote: $ react-scripts build
remote: Creating an optimized production build...
remote: Compiled successfully.
remote:
remote: File sizes after gzip:
remote:
remote: 74.78 KB build/static/js/2.543da256.chunk.js
remote: 17.95 KB build/static/css/2.cd1c2086.chunk.css
remote: 4.94 KB build/static/js/main.ea12f483.chunk.js
remote: 774 B build/static/js/runtime-main.aa4df6ff.js
remote: 648 B build/static/css/main.0c9e3b3d.chunk.css
remote:
remote: The project was built assuming it is hosted at /.
remote: You can control this with the homepage field in your package.json.
remote:
remote: The build folder is ready to be deployed.
remote: You may serve it with a static server:
remote:
remote: yarn global add serve
remote: serve -s build
remote:
remote: Find out more about deployment here:
remote:
remote: bit.ly/CRA-deploy
remote:
remote: Done in 24.62s.
remote:
remote: -----> Pruning devDependencies
remote: yarn install v1.22.5
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents@2.1.2: The platform "linux" is incompatible with this module.
remote: info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info fsevents@2.1.3: The platform "linux" is incompatible with this module.
remote: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
remote: [4/4] Building fresh packages...
remote: warning Ignored scripts due to flag.
remote: Done in 9.62s.
remote:
remote: -----> Caching build
remote: - yarn cache
remote:
remote: -----> Build succeeded!
remote: ! Unmet dependencies don't fail yarn install but may cause runtime issues
remote: https://github.com/npm/npm/issues/7494
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 83.8M
remote: -----> Launching...
remote: Released v6
remote: https://meghraj-portfolio.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/meghraj-portfolio.git
2564ea5..399ff3f master -> master
任何人都可以帮助我了解即使构建成功后导致应用程序在heroku上崩溃的原因。我无法从heroku cli的日志中找出任何东西。 如果我在本地运行相同,则工作正常。 任何帮助将不胜感激。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。