heroku 部署在本地工作但在生产中失败

时间:2021-02-05 05:29:06

标签: heroku

我已经能够在 heroku 上部署我的应用程序,但是当我尝试从浏览器运行该应用程序时,出现错误。但是,当我使用 'heroku local' 在本地运行它时,一切正常。这是我的 heroku 日志。

2021-02-05T05:13:47.489900+00:00 app[web.1]: > node -r esm app.js
2021-02-05T05:13:47.489901+00:00 app[web.1]:
2021-02-05T05:13:49.413465+00:00 app[web.1]: Fri, 05 Feb 2021 05:13:49 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827
2021-02-05T05:13:56.667223+00:00 app[web.1]: { logging: [Function (anonymous)], pool: undefined }
2021-02-05T05:13:56.759304+00:00 app[web.1]: /app/node_modules/sequelize/lib/sequelize.js:1
2021-02-05T05:13:56.759307+00:00 app[web.1]: TypeError: Cannot read property 'replace' of null
2021-02-05T05:13:56.759311+00:00 app[web.1]: at new Sequelize (/app/node_modules/sequelize/lib/sequelize.js:187:43)
2021-02-05T05:13:56.759312+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:59:33)
2021-02-05T05:13:56.759313+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:186:10)       
2021-02-05T05:13:56.759313+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:20:10)    
2021-02-05T05:13:56.759314+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17)
2021-02-05T05:13:56.759315+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38)
2021-02-05T05:13:56.759315+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:231:10)
2021-02-05T05:13:56.759315+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:35:15)
2021-02-05T05:13:56.759316+00:00 app[web.1]: at Generator.next (<anonymous>)
2021-02-05T05:13:56.836169+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-02-05T05:13:56.836927+00:00 app[web.1]: npm ERR! errno 1
2021-02-05T05:13:56.851571+00:00 app[web.1]: npm ERR! my-app@0.0.1 start: `node -r esm app.js`
2021-02-05T05:13:56.852016+00:00 app[web.1]: npm ERR! Exit status 1
2021-02-05T05:13:56.852545+00:00 app[web.1]: npm ERR!
2021-02-05T05:13:56.852778+00:00 app[web.1]: npm ERR! Failed at the my-app@0.0.1 start script.
2021-02-05T05:13:56.853159+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-02-05T05:13:56.866919+00:00 app[web.1]:
2021-02-05T05:13:56.868452+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-05T05:13:56.868646+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-05T05_13_56_854Z-debug.log
2021-02-05T05:13:56.983609+00:00 heroku[web.1]: Process exited with status 1
2021-02-05T05:13:57.066437+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-05T05:13:57.081387+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-05T05:14:02.321974+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-05T05:14:05.277648+00:00 app[web.1]:
2021-02-05T05:14:05.277671+00:00 app[web.1]: > my-app@0.0.1 start /app
2021-02-05T05:14:05.277672+00:00 app[web.1]: > node -r esm app.js
2021-02-05T05:14:05.277672+00:00 app[web.1]:
2021-02-05T05:14:06.100574+00:00 app[web.1]: Fri, 05 Feb 2021 05:14:06 GMT morgan deprecated default format: use combined format at node_modules/esm/esm.js:1:278827
2021-02-05T05:14:09.120724+00:00 app[web.1]: { logging: [Function (anonymous)], pool: undefined }
2021-02-05T05:14:09.144696+00:00 app[web.1]: /app/node_modules/sequelize/lib/sequelize.js:1
2021-02-05T05:14:09.144698+00:00 app[web.1]: TypeError: Cannot read property 'replace' of null
2021-02-05T05:14:09.144702+00:00 app[web.1]: at new Sequelize (/app/node_modules/sequelize/lib/sequelize.js:187:43)
2021-02-05T05:14:09.144703+00:00 app[web.1]: at new SequelizeAdapter (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:59:33)
2021-02-05T05:14:09.144705+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/store/sequelize.js:186:10)       
2021-02-05T05:14:09.144706+00:00 app[web.1]: at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:20:10)    
2021-02-05T05:14:09.144707+00:00 app[web.1]: at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17)
2021-02-05T05:14:09.144707+00:00 app[web.1]: at new Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38)
2021-02-05T05:14:09.144707+00:00 app[web.1]: at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:231:10)
2021-02-05T05:14:09.144708+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:35:15)
2021-02-05T05:14:09.144708+00:00 app[web.1]: at Generator.next (<anonymous>)
2021-02-05T05:14:09.161568+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-02-05T05:14:09.161939+00:00 app[web.1]: npm ERR! errno 1
2021-02-05T05:14:09.167351+00:00 app[web.1]: npm ERR! my-app@0.0.1 start: `node -r esm app.js`
2021-02-05T05:14:09.167501+00:00 app[web.1]: npm ERR! Exit status 1
2021-02-05T05:14:09.167653+00:00 app[web.1]: npm ERR!
2021-02-05T05:14:09.167784+00:00 app[web.1]: npm ERR! Failed at the my-app@0.0.1 start script.
2021-02-05T05:14:09.167926+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
2021-02-05T05:14:09.174845+00:00 app[web.1]:
2021-02-05T05:14:09.174972+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-05T05:14:09.175046+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-05T05_14_09_168Z-debug.log
2021-02-05T05:14:09.221429+00:00 heroku[web.1]: Process exited with status 1
2021-02-05T05:14:09.283635+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-05T05:14:10.652156+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=dynamic-check.herokuapp.com request_id=e314ef12-ba98-4f42-a0f5-9705d79066bf fwd="197.210.52.46" dyno= connect= service= status=503 bytes= protocol=https
2021-02-05T05:14:12.627551+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=dynamic-check.herokuapp.com request_id=3932bb9f-0351-454a-afb1-6739214447c4 fwd="197.210.52.46" dyno= connect= service= status=503 bytes= protocol=https

我试图卸载 sequelize 只是为了让代码通过,但仍然遇到相同的错误。我也在本地安装了 pg,但没有任何效果。

0 个答案:

没有答案