heroku deployment error springboot & angularjs - angularjs

heroku deployment error springboot & angularjs
I want to deploy to heroku an app i made but i have the following error log when accessing the app
angularjs files are in the resources/public file
no #Controller in teh code, only #RestControllers
heroku logs
2016-10-13T13:20:33.599545+00:00 heroku[web.1]: State changed from up to crashed
2016-10-13T13:20:33.584354+00:00 heroku[web.1]: Process exited with status 1
2016-10-13T13:25:42.179094+00:00 heroku[api]: Deploy d36a2ab by gabrielvoicujpi#gmail.com
2016-10-13T13:25:42.179155+00:00 heroku[api]: Release v4 created by gabrielvoicujpi#gmail.com
2016-10-13T13:25:42.400208+00:00 heroku[slug-compiler]: Slug compilation started
2016-10-13T13:25:42.400213+00:00 heroku[slug-compiler]: Slug compilation finished
2016-10-13T13:25:42.801854+00:00 heroku[web.1]: State changed from crashed to starting
2016-10-13T13:25:49.483010+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port 43279 target/*.war`
2016-10-13T13:25:51.505462+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2016-10-13T13:25:51.516519+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2016-10-13T13:25:52.141324+00:00 app[web.1]: Expanding zee-0.0.1-SNAPSHOT.war into /app/target/tomcat.43279/webapps/expanded
2016-10-13T13:25:52.141429+00:00 app[web.1]: Adding Context for /app/target/tomcat.43279/webapps/expanded
2016-10-13T13:25:52.802705+00:00 app[web.1]: Oct 13, 2016 1:25:52 PM org.apache.coyote.AbstractProtocol init
2016-10-13T13:25:52.802715+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-43279"]
2016-10-13T13:25:52.837120+00:00 app[web.1]: Oct 13, 2016 1:25:52 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2016-10-13T13:25:52.837123+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2016-10-13T13:25:52.843373+00:00 app[web.1]: Oct 13, 2016 1:25:52 PM org.apache.catalina.core.StandardService startInternal
2016-10-13T13:25:52.843376+00:00 app[web.1]: INFO: Starting service Tomcat
2016-10-13T13:25:52.844718+00:00 app[web.1]: Oct 13, 2016 1:25:52 PM org.apache.catalina.core.StandardEngine startInternal
2016-10-13T13:25:52.844720+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/8.0.30
2016-10-13T13:25:53.074753+00:00 heroku[web.1]: State changed from starting to up
2016-10-13T13:25:53.544355+00:00 app[web.1]: INFO: No global web.xml found
2016-10-13T13:25:53.544339+00:00 app[web.1]: Oct 13, 2016 1:25:53 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2016-10-13T13:26:00.615921+00:00 app[web.1]: Oct 13, 2016 1:26:00 PM org.apache.jasper.servlet.TldScanner scanJars
2016-10-13T13:26:00.637149+00:00 app[web.1]: Oct 13, 2016 1:26:00 PM org.apache.catalina.core.ContainerBase startInternal
2016-10-13T13:26:00.615944+00:00 app[web.1]: INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2016-10-13T13:26:00.637154+00:00 app[web.1]: SEVERE: A child container failed during start
2016-10-13T13:26:00.637158+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2016-10-13T13:26:00.637158+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2016-10-13T13:26:00.637156+00:00 app[web.1]: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2016-10-13T13:26:00.637160+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2016-10-13T13:26:00.637160+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
2016-10-13T13:26:00.637161+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.637162+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
2016-10-13T13:26:00.637163+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
2016-10-13T13:26:00.637163+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2016-10-13T13:26:00.637164+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-10-13T13:26:00.637164+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-10-13T13:26:00.637165+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:745)
2016-10-13T13:26:00.637179+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2016-10-13T13:26:00.637180+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-10-13T13:26:00.637182+00:00 app[web.1]: ... 6 more
2016-10-13T13:26:00.637183+00:00 app[web.1]: Caused by: java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringManager.getManager(Ljava/lang/Class;)Lorg/apache/tomcat/util/res/StringManager;
2016-10-13T13:26:00.637184+00:00 app[web.1]: at org.apache.tomcat.websocket.WsWebSocketContainer.<clinit>(WsWebSocketContainer.java:77)
2016-10-13T13:26:00.637185+00:00 app[web.1]: at org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131)
2016-10-13T13:26:00.637186+00:00 app[web.1]: at org.apache.tomcat.websocket.server.WsSci.onStartup(WsSci.java:47)
2016-10-13T13:26:00.637186+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5244)
2016-10-13T13:26:00.637187+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.637188+00:00 app[web.1]: ... 6 more
2016-10-13T13:26:00.637188+00:00 app[web.1]:
2016-10-13T13:26:00.638936+00:00 app[web.1]: Oct 13, 2016 1:26:00 PM org.apache.catalina.core.ContainerBase startInternal
2016-10-13T13:26:00.638937+00:00 app[web.1]: SEVERE: A child container failed during start
2016-10-13T13:26:00.638938+00:00 app[web.1]: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
2016-10-13T13:26:00.638939+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2016-10-13T13:26:00.638940+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2016-10-13T13:26:00.638940+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2016-10-13T13:26:00.638941+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2016-10-13T13:26:00.638942+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.638942+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
2016-10-13T13:26:00.638943+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.638944+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.638943+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
2016-10-13T13:26:00.638945+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:344)
2016-10-13T13:26:00.638945+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:261)
2016-10-13T13:26:00.638957+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-10-13T13:26:00.638958+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
2016-10-13T13:26:00.638955+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
2016-10-13T13:26:00.638959+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2016-10-13T13:26:00.638957+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
2016-10-13T13:26:00.638961+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:745)
2016-10-13T13:26:00.638962+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2016-10-13T13:26:00.638959+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-10-13T13:26:00.638960+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-10-13T13:26:00.638963+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
2016-10-13T13:26:00.638964+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.638965+00:00 app[web.1]: ... 6 more
2016-10-13T13:26:00.638962+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
2016-10-13T13:26:00.638965+00:00 app[web.1]:
2016-10-13T13:26:00.639458+00:00 app[web.1]: Exception in thread "main" org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
2016-10-13T13:26:00.639613+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:344)
2016-10-13T13:26:00.639544+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-10-13T13:26:00.639681+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:261)
2016-10-13T13:26:00.639808+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
2016-10-13T13:26:00.639920+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
2016-10-13T13:26:00.639863+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-10-13T13:26:00.639984+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.640041+00:00 app[web.1]: ... 2 more
2016-10-13T13:26:00.640152+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
2016-10-13T13:26:00.640281+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)
2016-10-13T13:26:00.640401+00:00 app[web.1]: ... 4 more
2016-10-13T13:26:00.640513+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2016-10-13T13:26:00.640217+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-10-13T13:26:00.640343+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.640658+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2016-10-13T13:26:00.640727+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-10-13T13:26:00.640588+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:924)
2016-10-13T13:26:00.640785+00:00 app[web.1]: ... 6 more
2016-10-13T13:26:01.036824+00:00 heroku[web.1]: Process exited with status 1
2016-10-13T13:26:00.946067+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=demowebsitezee2.herokuapp.com request_id=c52590a1-7379-4c49-a312-ebe64e2bae29 fwd="5.2.224.229" dyno=web.1 connect=6ms service=6250ms status=503 bytes=0
2016-10-13T13:26:01.073458+00:00 heroku[web.1]: State changed from up to crashed
2016-10-13T13:26:01.335026+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=demowebsitezee2.herokuapp.com request_id=99691c07-53eb-4759-a246-d22843a6fee8 fwd="5.2.224.229" dyno= connect= service= status=503 bytes=
pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zee</groupId>
<artifactId>zee</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Zee</name>
<description>Zee's Personal Website</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>8.0.30.2</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Can you please tell me what to do ?
Thanks

Related

Issue deploying a reactjs app to herokuapp online

Error
2021-01-19T05:38:29.490890+00:00 app[web.1]: > MIT-Ask#1.0.0 start
2021-01-19T05:38:29.490895+00:00 app[web.1]: > nodemon --ignore client/ node index.js
2021-01-19T05:38:29.490895+00:00 app[web.1]:
2021-01-19T05:38:30.619237+00:00 app[web.1]: [33m[nodemon] 2.0.6[39m
2021-01-19T05:38:30.620714+00:00 app[web.1]: [33m[nodemon] to restart at any time, enter `rs`[39m
2021-01-19T05:38:30.621395+00:00 app[web.1]: [33m[nodemon] watching path(s): *.*[39m
2021-01-19T05:38:30.621500+00:00 app[web.1]: [33m[nodemon] watching extensions: js,mjs,json[39m
2021-01-19T05:38:30.622155+00:00 app[web.1]: [32m[nodemon] starting `node node index.js server/server.js`[39m
2021-01-19T05:38:33.899415+00:00 app[web.1]: node:internal/modules/cjs/loader:928
2021-01-19T05:38:33.899424+00:00 app[web.1]: throw err;
2021-01-19T05:38:33.899425+00:00 app[web.1]: ^
2021-01-19T05:38:33.899425+00:00 app[web.1]:
2021-01-19T05:38:33.899426+00:00 app[web.1]: Error: Cannot find module 'webpack'
2021-01-19T05:38:33.899426+00:00 app[web.1]: Require stack:
2021-01-19T05:38:33.899427+00:00 app[web.1]: - /app/webpack.config.js
2021-01-19T05:38:33.899427+00:00 app[web.1]: - /app/server/api.js
2021-01-19T05:38:33.899428+00:00 app[web.1]: - /app/server/server.js
2021-01-19T05:38:33.899429+00:00 app[web.1]: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
2021-01-19T05:38:33.899429+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:769:27)
2021-01-19T05:38:33.899430+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:997:19)
2021-01-19T05:38:33.899430+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:92:18)
2021-01-19T05:38:33.899430+00:00 app[web.1]: at Object.<anonymous> (/app/webpack.config.js:23:17)
2021-01-19T05:38:33.899431+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1108:14)
2021-01-19T05:38:33.899431+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
2021-01-19T05:38:33.899432+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:973:32)
2021-01-19T05:38:33.899433+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:813:14)
2021-01-19T05:38:33.899433+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:997:19)
2021-01-19T05:38:33.899433+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:92:18)
2021-01-19T05:38:33.899434+00:00 app[web.1]: at Object.<anonymous> (/app/server/api.js:55:21)
2021-01-19T05:38:33.899435+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1108:14)
2021-01-19T05:38:33.899435+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
2021-01-19T05:38:33.899435+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:973:32)
2021-01-19T05:38:33.899436+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:813:14) {
2021-01-19T05:38:33.899436+00:00 app[web.1]: code: 'MODULE_NOT_FOUND',
2021-01-19T05:38:33.899437+00:00 app[web.1]: requireStack: [
2021-01-19T05:38:33.899437+00:00 app[web.1]: '/app/webpack.config.js',
2021-01-19T05:38:33.899437+00:00 app[web.1]: '/app/server/api.js',
2021-01-19T05:38:33.899438+00:00 app[web.1]: '/app/server/server.js'
2021-01-19T05:38:33.899438+00:00 app[web.1]: ]
2021-01-19T05:38:33.899438+00:00 app[web.1]: }
2021-01-19T05:38:33.914301+00:00 app[web.1]: [31m[nodemon] app crashed - waiting for file changes before starting...[39m
2021-01-19T05:39:25.752043+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-01-19T05:39:25.778172+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-01-19T05:39:25.939029+00:00 heroku[web.1]: Process exited with status 137
2021-01-19T05:39:25.986786+00:00 heroku[web.1]: State changed from starting to crashed
2021-01-19T05:39:29.247585+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mit-ask.herokuapp.com request_id=80c88480-df28-495a-9caf-dac6cd348f3b fwd="24.193.86.195" dyno= connect= service= status=503 bytes= protocol=https
2021-01-19T05:39:29.667520+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mit-ask.herokuapp.com request_id=38dc7bc6-c389-4e27-bd13-da8e20804b4f fwd="24.193.86.195" dyno= connect= service= status=503 bytes= protocol=https
2021-01-19T05:39:29.971285+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mit-ask.herokuapp.com request_id=f241cef6-8ff4-49df-baff-97d9818c9228 fwd="24.193.86.195" dyno= connect= service= status=503 bytes= protocol=https
I have looked up many of the solutions and reinstalled webpack. When I start up the app in vscode myself, everything works fine. Commands npm start and npm run hotloader both start up the server and the actual app fine. When I deploy it, it says successful but when I try to load the site, it gives the above error.
In my server.js file, I have const port = process.env.PORT || 3000, but it's still giving me the Web process failed to bind to $PORT within 60 seconds of launch error. I'm not sure what's wrong here.
On another platform, someone was able to successfully help me with this.
They said that it fails to bind to the port cause the server failed to start. Heroku deletes devDependencies after the first build, so webpack is probably deleted by the time the server starts.
The issue was that I was importing webpack in my api.js that wasn't necessary. After deleting that, the Heroku app deployed fine.

Application error while deploying react.js project over heroku

i created an application with React.Js which fetches data using API. But when i tried deploying it over Heroku platform, it gave me error : Application Error
I have executed the steps specified on the heroku website, it is as follows:
Install the Heroku CLI
Download and install the Heroku CLI.
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.
$ heroku login
Clone the repository
Use Git to clone app's source code to your local machine.
$ heroku git:clone -a app-name
$ cd app-name
Deploy your changes
Make some changes to the code you just cloned and deploy them to Heroku using Git.
$ git add .
$ git commit -am "make it better"
$ git push heroku master
It didn't worked!
Here is the log:
2020-06-22T12:40:27.850239+00:00 app[web.1]: > react-scripts start
2020-06-22T12:40:27.850239+00:00 app[web.1]:
2020-06-22T12:40:34.380682+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.125.90/
2020-06-22T12:40:34.381510+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-22T12:40:34.381685+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-22T12:40:34.381845+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-22T12:40:34.382179+00:00 app[web.1]: Starting the development server...
2020-06-22T12:40:34.382181+00:00 app[web.1]:
2020-06-22T12:40:34.546503+00:00 heroku[web.1]: Process exited with status 0
2020-06-22T12:40:34.619734+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-22T14:12:41.785222+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-22T14:12:52.279485+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-22T14:12:55.303019+00:00 app[web.1]:
2020-06-22T14:12:55.303037+00:00 app[web.1]: > covidtracker#0.1.0 start /app
2020-06-22T14:12:55.303038+00:00 app[web.1]: > react-scripts start
2020-06-22T14:12:55.303038+00:00 app[web.1]:
2020-06-22T14:12:58.615357+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.197.178/
2020-06-22T14:12:58.616148+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-22T14:12:58.616286+00:00 app[web.1]: ℹ 「wds��: Content not from webpack is served from /app/public
2020-06-22T14:12:58.616415+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-22T14:12:58.616671+00:00 app[web.1]: Starting the development server...
2020-06-22T14:12:58.616672+00:00 app[web.1]:
2020-06-22T14:12:58.788743+00:00 heroku[web.1]: Process exited with status 0
2020-06-22T14:12:58.845133+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-22T17:03:45.196711+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-22T17:03:58.482038+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-22T17:04:02.420806+00:00 app[web.1]:
2020-06-22T17:04:02.420839+00:00 app[web.1]: > covidtracker#0.1.0 start /app
2020-06-22T17:04:02.420839+00:00 app[web.1]: > react-scripts start
2020-06-22T17:04:02.420840+00:00 app[web.1]:
2020-06-22T17:04:09.746354+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.93.82/
2020-06-22T17:04:09.746878+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-22T17:04:09.747007+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-22T17:04:09.747116+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-22T17:04:09.747412+00:00 app[web.1]: Starting the development server...
2020-06-22T17:04:09.747413+00:00 app[web.1]:
2020-06-22T17:04:09.999824+00:00 heroku[web.1]: Process exited with status 0
2020-06-22T17:04:10.062284+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-22T22:50:40.650238+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-22T22:50:48.917468+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-22T22:50:51.112063+00:00 app[web.1]:
2020-06-22T22:50:51.112085+00:00 app[web.1]: > covidtracker#0.1.0 start /app
2020-06-22T22:50:51.112086+00:00 app[web.1]: > react-scripts start
2020-06-22T22:50:51.112086+00:00 app[web.1]:
2020-06-22T22:50:53.533795+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.140.22/
2020-06-22T22:50:53.534116+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-22T22:50:53.534199+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-22T22:50:53.534267+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-22T22:50:53.534433+00:00 app[web.1]: Starting the development server...
2020-06-22T22:50:53.534434+00:00 app[web.1]:
2020-06-22T22:50:53.615116+00:00 heroku[web.1]: Process exited with status 0
2020-06-22T22:50:53.658116+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-23T04:30:26.154959+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-23T04:30:33.609175+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-23T04:30:35.459308+00:00 app[web.1]:
2020-06-23T04:30:35.459322+00:00 app[web.1]: > covidtracker#0.1.0 start /app
2020-06-23T04:30:35.459322+00:00 app[web.1]: > react-scripts start
2020-06-23T04:30:35.459323+00:00 app[web.1]:
2020-06-23T04:30:37.539192+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.16.168.226/
2020-06-23T04:30:37.539532+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-23T04:30:37.539611+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-23T04:30:37.539677+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-23T04:30:37.539842+00:00 app[web.1]: Starting the development server...
2020-06-23T04:30:37.539843+00:00 app[web.1]:
2020-06-23T04:30:37.607952+00:00 heroku[web.1]: Process exited with status 0
2020-06-23T04:30:37.640598+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-23T09:58:58.290664+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-23T09:59:07.251577+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-23T09:59:10.172374+00:00 app[web.1]:
2020-06-23T09:59:10.172390+00:00 app[web.1]: > covidtracker#0.1.0 start /app
2020-06-23T09:59:10.172390+00:00 app[web.1]: > react-scripts start
2020-06-23T09:59:10.172390+00:00 app[web.1]:
2020-06-23T09:59:12.250288+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.189.230/
2020-06-23T09:59:12.250803+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-23T09:59:12.250906+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-23T09:59:12.251013+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-23T09:59:12.251258+00:00 app[web.1]: Starting the development server...
2020-06-23T09:59:12.251259+00:00 app[web.1]:
2020-06-23T09:59:12.385028+00:00 heroku[web.1]: Process exited with status 0
2020-06-23T09:59:12.442788+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-23T15:35:27.646908+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-23T15:35:36.951718+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-23T15:35:39.713025+00:00 app[web.1]:
2020-06-23T15:35:39.713071+00:00 app[web.1]: > covidtracker#0.1.0 start /app
2020-06-23T15:35:39.713071+00:00 app[web.1]: > react-scripts start
2020-06-23T15:35:39.713072+00:00 app[web.1]:
2020-06-23T15:35:42.169764+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.13.178/
2020-06-23T15:35:42.170140+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-06-23T15:35:42.170236+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-06-23T15:35:42.170324+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-06-23T15:35:42.170506+00:00 app[web.1]: Starting the development server...
2020-06-23T15:35:42.170510+00:00 app[web.1]:
2020-06-23T15:35:42.247228+00:00 heroku[web.1]: Process exited with status 0
2020-06-23T15:35:42.285901+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-23T16:23:37.027952+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=covid-007.herokuapp.com request_id=9b037027-7e0b-4a10-900e-9f306494d592 fwd="182.66.42.58" dyno= connect= service= status=503 bytes= protocol=https
2020-06-23T16:23:38.306139+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=covid-007.herokuapp.com request_id=db0251b8-ca7d-49d4-8561-f16d5834ab6f fwd="182.66.42.58" dyno= connect= service= status=503 bytes= protocol=https
2020-06-23T17:37:05.660570+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=covid-007.herokuapp.com request_id=a5b567d5-792c-492a-ba30-566590b7f3bf fwd="182.66.43.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-23T17:37:06.677313+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=covid-007.herokuapp.com request_id=8fa7e49f-d40e-48af-ba0a-db77420f8138 fwd="182.66.43.250" dyno= connect= service= status=503 bytes= protocol=https
2020-06-23T17:42:09.440304+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=covid-007.herokuapp.com request_id=b786c7e4-c4ff-4ce4-bd9c-139651c61845 fwd="182.66.168.226" dyno= connect= service= status=503 bytes= protocol=https
2020-06-23T17:42:10.695333+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=covid-007.herokuapp.com request_id=f16c168d-3bf6-40fe-ba7c-60c9f5b8199e fwd="182.66.168.226" dyno= connect= service= status=503 bytes= protocol=https
Here is my package.json:
{
"name": "covidtracker",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.10.2",
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"axios": "^0.19.2",
"chart.js": "^2.9.3",
"classnames": "^2.2.6",
"react": "^16.13.1",
"react-chartjs-2": "^2.9.0",
"react-countup": "^4.3.3",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Any sort of help would be appreciated as i'm totally clueless!
In Settings change the buildpack to https://github.com/mars/create-react-app-buildpack and then deploy again, this problem will get solved. It worked for me!
I had the same issue. Not sure what's going on behind the scenes but for me it was the react scripts package. After rolling back react-scripts package from 3.4.1 to 3.4.0 it fixed the issue.

Heroku error code h10 when trying to deploy react app

Hin im kinda new to web development. I built a react website but i can't manage to deploy it on heroku.
package.json:
"scripts": {
"dev": "react-scripts start",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"heroku-postbuild": "npm run build"
},
I have a Procfile next to my package.json with :
web:npm start
console throw this error when i do herolu logs --tail :
2020-04-25T09:16:16.142345+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vertikalreunion.herokuapp.com request_id=f7d41b53-de86-4b4d-83fb-994cab236581 fwd="82.64.226.67" dyno= connect= service= status=503 bytes= protocol=https
2020-04-25T09:16:27.595683+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T09:16:51.753401+00:00 app[web.1]:
2020-04-25T09:16:51.753423+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T09:16:51.753423+00:00 app[web.1]: > react-scripts start
2020-04-25T09:16:51.753423+00:00 app[web.1]:
2020-04-25T09:16:54.009357+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T09:16:53.900786+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.16.53.194/
2020-04-25T09:16:53.901127+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T09:16:53.901196+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T09:16:53.901262+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T09:16:53.901440+00:00 app[web.1]: Starting the development server...
2020-04-25T09:16:53.901458+00:00 app[web.1]:
2020-04-25T09:16:55.709712+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vertikalreunion.herokuapp.com request_id=09ca158b-97f3-4693-9393-cd06adf078f5 fwd="82.64.226.67" dyno= connect= service= status=503 bytes= protocol=https
2020-04-25T09:19:08.785514+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T09:19:30.469551+00:00 app[web.1]:
2020-04-25T09:19:30.469601+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T09:19:30.469602+00:00 app[web.1]: > react-scripts start
2020-04-25T09:19:30.469602+00:00 app[web.1]:
2020-04-25T09:19:32.893506+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T09:19:32.802075+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.19.5.2/
2020-04-25T09:19:32.802231+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T09:19:32.802333+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T09:19:32.802403+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T09:19:32.802595+00:00 app[web.1]: Starting the development server...
2020-04-25T09:19:32.802596+00:00 app[web.1]:
2020-04-25T09:41:17.364623+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T09:41:38.385042+00:00 app[web.1]:
2020-04-25T09:41:38.385060+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T09:41:38.385061+00:00 app[web.1]: > react-scripts start
2020-04-25T09:41:38.385061+00:00 app[web.1]:
2020-04-25T09:41:40.279176+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T09:41:40.184921+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.183.158/
2020-04-25T09:41:40.185258+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T09:41:40.185335+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T09:41:40.185406+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T09:41:40.185581+00:00 app[web.1]: Starting the development server...
2020-04-25T09:41:40.185582+00:00 app[web.1]:
2020-04-25T10:23:03.438472+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T10:23:25.751986+00:00 app[web.1]:
2020-04-25T10:23:25.752002+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T10:23:25.752002+00:00 app[web.1]: > react-scripts start
2020-04-25T10:23:25.752002+00:00 app[web.1]:
2020-04-25T10:23:28.152557+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T10:23:28.051089+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.19.226/
2020-04-25T10:23:28.051680+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T10:23:28.051715+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T10:23:28.051831+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T10:23:28.052068+00:00 app[web.1]: Starting the development server...
2020-04-25T10:23:28.052068+00:00 app[web.1]:
2020-04-25T11:42:46.689638+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vertikalreunion.herokuapp.com request_id=5ca84f44-a006-4deb-a61b-b288a3a04109 fwd="82.64.226.67" dyno= connect= service= status=503 bytes= protocol=https
2020-04-25T11:43:34.646592+00:00 app[api]: Starting process with command `printenv` by user velluetp#gmail.com
2020-04-25T11:43:52.591042+00:00 heroku[run.1701]: State changed from starting to up
2020-04-25T11:43:57.024009+00:00 heroku[run.1701]: State changed from up to complete
2020-04-25T11:46:45.991288+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T11:47:07.851528+00:00 app[web.1]:
2020-04-25T11:47:07.851557+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T11:47:07.851558+00:00 app[web.1]: > react-scripts start
2020-04-25T11:47:07.851558+00:00 app[web.1]:
2020-04-25T11:47:10.275055+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T11:47:10.153858+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.16.160.154/
2020-04-25T11:47:10.154471+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T11:47:10.154540+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T11:47:10.154659+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T11:47:10.154945+00:00 app[web.1]: Starting the development server...
2020-04-25T11:47:10.154946+00:00 app[web.1]:
2020-04-25T12:01:11.000000+00:00 app[api]: Build started by user velluetp#gmail.com
2020-04-25T12:01:57.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/9c187c58-5551-4ceb-8b9b-bc3ef1e25101/activity/builds/69305220-a27f-436d-8841-9f17a17017e4
2020-04-25T12:11:22.000000+00:00 app[api]: Build started by user velluetp#gmail.com
2020-04-25T12:13:26.032267+00:00 app[api]: Deploy d028d641 by user velluetp#gmail.com
2020-04-25T12:13:26.032267+00:00 app[api]: Release v12 created by user velluetp#gmail.com
2020-04-25T12:13:27.646789+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T12:13:39.000000+00:00 app[api]: Build succeeded
2020-04-25T12:13:48.056119+00:00 app[web.1]:
2020-04-25T12:13:48.056133+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T12:13:48.056133+00:00 app[web.1]: > react-scripts start
2020-04-25T12:13:48.056134+00:00 app[web.1]:
2020-04-25T12:13:50.150679+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T12:13:50.228845+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-25T12:13:50.028096+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.18.46.74/
2020-04-25T12:13:50.028436+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T12:13:50.028512+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T12:13:50.028579+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T12:13:50.028756+00:00 app[web.1]: Starting the development server...
2020-04-25T12:13:50.028757+00:00 app[web.1]:
2020-04-25T12:14:16.995981+00:00 app[web.1]:
2020-04-25T12:14:16.995997+00:00 app[web.1]: > vertikal#0.1.0 start /app
2020-04-25T12:14:16.995997+00:00 app[web.1]: > react-scripts start
2020-04-25T12:14:16.995998+00:00 app[web.1]:
2020-04-25T12:14:19.993371+00:00 heroku[web.1]: State changed from starting to crashed
2020-04-25T12:14:19.866235+00:00 app[web.1]: ℹ 「wds」: Project is running at http://172.17.253.118/
2020-04-25T12:14:19.866644+00:00 app[web.1]: ℹ 「wds」: webpack output is served from
2020-04-25T12:14:19.866749+00:00 app[web.1]: ℹ 「wds」: Content not from webpack is served from /app/public
2020-04-25T12:14:19.866883+00:00 app[web.1]: ℹ 「wds」: 404s will fallback to /
2020-04-25T12:14:19.867083+00:00 app[web.1]: Starting the development server...
2020-04-25T12:14:19.867084+00:00 app[web.1]:
2020-04-25T12:14:22.011941+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=vertikalreunion.herokuapp.com request_id=e69732b6-851b-46ca-9853-4a014a45f282 fwd="82.64.226.67" dyno= connect= service= status=503 bytes= protocol=https
2020-04-25T12:14:33.524773+00:00 app[api]: Starting process with command `rails console` by user velluetp#gmail.com
2020-04-25T12:14:54.113480+00:00 heroku[run.9122]: State changed from starting to up
2020-04-25T12:14:58.860885+00:00 heroku[run.9122]: State changed from up to complete
I have no idea where the problems comes from, even after hard-trying to find solution on the internet.
dont use to start scripts, remove "dev": "react-scripts start",
When using create-react-app and deploying to
dont delete the favicon.ico and manifest.json
also in package.json above scripts insert "engines": {
"npm": "6.x",
"node": "12.x"
},
//NOTE CHECK YOUR NODE AND NPM VERSIONS BY TYPING npm -v and node -v for accurate versions//
In heroku after heroku create command, go to heroku and change buildback under settings to https://github.com/mars/create-react-app-buildpack
Dont add other scripts or change the start, build scripts!
This should clear all h10 errors when deploying to heroku, if they dont i suggest you create a new directory and copy your files there and start over, this link is a great guide to deploy
https://dev.to/smithmanny/deploy-your-react-app-to-heroku-2b6f

Failed run application in heroku with adonis,next,react app framework

I have problem when deploy my app to heroku, i'm using react,next,adonis for build this app.
My env i put in reveal config vars heroku manually
This is my logs error in heroku tail
2019-08-20T09:26:20.148145+00:00 heroku[web.1]: Starting process with command `npm start`
2019-08-20T09:26:22.364045+00:00 app[web.1]:
2019-08-20T09:26:22.364077+00:00 app[web.1]: > adonis-fullstack-app#4.1.0 start /app
2019-08-20T09:26:22.364079+00:00 app[web.1]: > node server.js --production
2019-08-20T09:26:22.364081+00:00 app[web.1]:
2019-08-20T09:26:22.998945+00:00 app[web.1]:
2019-08-20T09:26:22.998985+00:00 app[web.1]: WARNING: Adonis has detected an unhandled promise rejection, which may
2019-08-20T09:26:22.998988+00:00 app[web.1]: cause undesired behavior in production.
2019-08-20T09:26:22.998991+00:00 app[web.1]: To stop this warning, use catch() on promises or wrap await
2019-08-20T09:26:22.998993+00:00 app[web.1]: calls inside try/catch.
2019-08-20T09:26:22.998995+00:00 app[web.1]:
2019-08-20T09:26:23.003594+00:00 app[web.1]: { Error: ENOENT: no such file or directory, open '/app/.env'
2019-08-20T09:26:23.003598+00:00 app[web.1]: at Object.openSync (fs.js:443:3)
2019-08-20T09:26:23.003600+00:00 app[web.1]: at Object.readFileSync (fs.js:343:35)
2019-08-20T09:26:23.003602+00:00 app[web.1]: at Env.load (/app/node_modules/#adonisjs/framework/src/Env/index.js:110:41)
2019-08-20T09:26:23.003605+00:00 app[web.1]: at new Env (/app/node_modules/#adonisjs/framework/src/Env/index.js:42:22)
2019-08-20T09:26:23.003607+00:00 app[web.1]: at Object.app.singleton [as closure] (/app/node_modules/#adonisjs/framework/providers/AppProvider.js:29:14)
2019-08-20T09:26:23.003610+00:00 app[web.1]: at Ioc._resolveBinding (/app/node_modules/#adonisjs/fold/src/Ioc/index.js:231:68)
2019-08-20T09:26:23.003612+00:00 app[web.1]: at Ioc.use (/app/node_modules/#adonisjs/fold/src/Ioc/index.js:731:19)
2019-08-20T09:26:23.003614+00:00 app[web.1]: at NextProvider.register (/app/node_modules/adonis-nextjs/providers/NextProvider/index.js:38:24)
2019-08-20T09:26:23.003615+00:00 app[web.1]: at _.filter.each (/app/node_modules/#adonisjs/fold/src/Registrar/index.js:128:36)
2019-08-20T09:26:23.003618+00:00 app[web.1]: at arrayEach (/app/node_modules/lodash/lodash.js:516:11) errno: -2, syscall: 'open', code: 'ENOENT', path: '/app/.env' }
2019-08-20T09:26:23.021016+00:00 app[web.1]:
2019-08-20T09:26:23.021021+00:00 app[web.1]: Error: ENOENT: no such file or directory, open '/app/.env'
2019-08-20T09:26:23.021023+00:00 app[web.1]:
2019-08-20T09:26:23.021024+00:00 app[web.1]:
2019-08-20T09:26:23.021026+00:00 app[web.1]: 1 Env.load
2019-08-20T09:26:23.021028+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/src/Env/index.js:110
2019-08-20T09:26:23.021030+00:00 app[web.1]:
2019-08-20T09:26:23.021032+00:00 app[web.1]: 2 new Env
2019-08-20T09:26:23.021035+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/src/Env/index.js:42
2019-08-20T09:26:23.021036+00:00 app[web.1]:
2019-08-20T09:26:23.021039+00:00 app[web.1]: 3 Object.app.singleton [as closure]
2019-08-20T09:26:23.021041+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/providers/AppProvider.js:29
2019-08-20T09:26:23.021043+00:00 app[web.1]:
2019-08-20T09:26:23.021045+00:00 app[web.1]: 4 Ioc._resolveBinding
2019-08-20T09:26:23.021047+00:00 app[web.1]: /app/node_modules/#adonisjs/fold/src/Ioc/index.js:231
2019-08-20T09:26:23.021049+00:00 app[web.1]:
2019-08-20T09:26:23.021051+00:00 app[web.1]: 5 Ioc.use
2019-08-20T09:26:23.021053+00:00 app[web.1]: /app/node_modules/#adonisjs/fold/src/Ioc/index.js:731
2019-08-20T09:26:23.021055+00:00 app[web.1]:
2019-08-20T09:26:23.021057+00:00 app[web.1]: 6 AppProvider.boot
2019-08-20T09:26:23.021059+00:00 app[web.1]: /app/node_modules/#adonisjs/framework/providers/AppProvider.js:337
2019-08-20T09:26:23.021061+00:00 app[web.1]:
2019-08-20T09:26:23.021063+00:00 app[web.1]: 7 _.filter.map
2019-08-20T09:26:23.021065+00:00 app[web.1]: /app/node_modules/#adonisjs/fold/src/Registrar/index.js:147
2019-08-20T09:26:23.021066+00:00 app[web.1]:
2019-08-20T09:26:23.021068+00:00 app[web.1]: 8 arrayMap
2019-08-20T09:26:23.021070+00:00 app[web.1]: /app/node_modules/lodash/lodash.js:639
2019-08-20T09:26:23.021072+00:00 app[web.1]:
2019-08-20T09:26:23.029460+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-08-20T09:26:23.029933+00:00 app[web.1]: npm ERR! errno 1
2019-08-20T09:26:23.031184+00:00 app[web.1]: npm ERR! adonis-fullstack-app#4.1.0 start: `node server.js --production`
2019-08-20T09:26:23.031327+00:00 app[web.1]: npm ERR! Exit status 1
2019-08-20T09:26:23.031582+00:00 app[web.1]: npm ERR!
2019-08-20T09:26:23.031795+00:00 app[web.1]: npm ERR! Failed at the adonis-fullstack-app#4.1.0 start script.
2019-08-20T09:26:23.032063+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-08-20T09:26:23.037560+00:00 app[web.1]:
2019-08-20T09:26:23.037776+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-08-20T09:26:23.037921+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-08-20T09_26_23_033Z-debug.log
2019-08-20T09:26:23.100987+00:00 heroku[web.1]: Process exited with status 1
2019-08-20T09:26:23.118856+00:00 heroku[web.1]: State changed from starting to crashed
2019-08-20T09:26:35.633644+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myapp.herokuapp.com request_id=d42ff289-f989-4386-a521-d22a650b44ba fwd="103.87.85.198" dyno= connect= service= status=503 bytes= protocol=https
2019-08-20T09:26:35.979151+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myapp.herokuapp.com request_id=44d7c31f-3b53-49dd-a6b0-13fa5b113004 fwd="103.87.85.198" dyno= connect= service= status=503 bytes= protocol=https
I already try some solution in another forum but not solved
This is my package json
"scripts": {
"start": "node server.js --production",
"heroku-postbuild": "npm run build",
"test": "node ace test",
"dev": "node server.js",
"build": "next build ./next",
"export": "next export ./next"
},
I already look in another but maybe not same implement with my project, any solution?
Do you have the ENV_SILENT parameter in the heroku variables?
Have a nice day
If .env file is missing, AdonisJs throws an exception by default. However, you turn off the exception as follows
somewhere in your code, you are trying to open the .env file. so generate an error.
You can disable .env file and directly use your system environment variables visit this page for more information

Deploying on Heroku using Node.js application fails

I'm following the book Getting MEAN with Mongo, Express, Angular and Node.js and I'm trying to deploy my application to Heroku. I already did it but can't access the live URL, cause I get an application error. I don't know what is happening and why it didn't work, I followed all the concepts in the book.
Here is the tail log from the cmd
2016-10-11T19:51:45.814527+00:00 heroku[api]: Deploy d98fd8a by filipecosta_10#h
otmail.com
2016-10-11T19:51:45.814527+00:00 heroku[api]: Release v3 created by filipecosta_
10#hotmail.com
2016-10-11T19:51:47.335153+00:00 heroku[slug-compiler]: Slug compilation started
2016-10-11T19:51:47.335158+00:00 heroku[slug-compiler]: Slug compilation finishe
d
2016-10-11T19:51:48.026456+00:00 heroku[web.1]: Starting process with command `n
pm start`
2016-10-11T19:51:50.965855+00:00 app[web.1]:
2016-10-11T19:51:50.965871+00:00 app[web.1]: > loc8r#0.0.0 start /app
2016-10-11T19:51:50.965872+00:00 app[web.1]: > node ./bin/www
2016-10-11T19:51:50.965873+00:00 app[web.1]:
2016-10-11T19:51:51.158696+00:00 app[web.1]: module.js:327
2016-10-11T19:51:51.158699+00:00 app[web.1]: throw err;
2016-10-11T19:51:51.158699+00:00 app[web.1]: ^
2016-10-11T19:51:51.158700+00:00 app[web.1]:
2016-10-11T19:51:51.158701+00:00 app[web.1]: Error: Cannot find module '../contr
ollers/main'
2016-10-11T19:51:51.158702+00:00 app[web.1]: at Function.Module._resolveFile
name (module.js:325:15)
2016-10-11T19:51:51.158703+00:00 app[web.1]: at Function.Module._load (modul
e.js:276:25)
2016-10-11T19:51:51.158703+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:51.158704+00:00 app[web.1]: at require (internal/module.js:
12:17)
2016-10-11T19:51:51.158705+00:00 app[web.1]: at Object.<anonymous> (/app/app
_server/routes/index.js:3:17)
2016-10-11T19:51:51.158705+00:00 app[web.1]: at Module._compile (module.js:4
09:26)
2016-10-11T19:51:51.158706+00:00 app[web.1]: at Object.Module._extensions..j
s (module.js:416:10)
2016-10-11T19:51:51.158706+00:00 app[web.1]: at Module.load (module.js:343:3
2)
2016-10-11T19:51:51.158707+00:00 app[web.1]: at Function.Module._load (modul
e.js:300:12)
2016-10-11T19:51:51.158708+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:51.167422+00:00 app[web.1]:
2016-10-11T19:51:51.174247+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi
n/node" "/app/.heroku/node/bin/npm" "start"
2016-10-11T19:51:51.173815+00:00 app[web.1]: npm ERR! Linux 3.13.0-95-generic
2016-10-11T19:51:51.174531+00:00 app[web.1]: npm ERR! node v4.5.0
2016-10-11T19:51:51.174888+00:00 app[web.1]: npm ERR! npm v2.15.11
2016-10-11T19:51:51.175128+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-10-11T19:51:51.175398+00:00 app[web.1]: npm ERR! loc8r#0.0.0 start: `node .
/bin/www`
2016-10-11T19:51:51.175544+00:00 app[web.1]: npm ERR! Exit status 1
2016-10-11T19:51:51.175660+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:51.175761+00:00 app[web.1]: npm ERR! Failed at the loc8r#0.0.0
start script 'node ./bin/www'.
2016-10-11T19:51:51.175878+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the loc8r package,
2016-10-11T19:51:51.176070+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-10-11T19:51:51.176164+00:00 app[web.1]: npm ERR! node ./bin/www
2016-10-11T19:51:51.176253+00:00 app[web.1]: npm ERR! You can get information on
how to open an issue for this project with:
2016-10-11T19:51:51.175977+00:00 app[web.1]: npm ERR! not with npm itself.
2016-10-11T19:51:51.176393+00:00 app[web.1]: npm ERR! npm bugs loc8r
2016-10-11T19:51:51.176495+00:00 app[web.1]: npm ERR! Or if that isn't available
, you can get their info via:
2016-10-11T19:51:51.176593+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:51.176685+00:00 app[web.1]: npm ERR! npm owner ls loc8r
2016-10-11T19:51:51.176781+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-10-11T19:51:51.180051+00:00 app[web.1]:
2016-10-11T19:51:51.180327+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-10-11T19:51:51.180221+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-10-11T19:51:51.279651+00:00 heroku[web.1]: State changed from starting to c
rashed
2016-10-11T19:51:51.280869+00:00 heroku[web.1]: State changed from crashed to st
arting
2016-10-11T19:51:51.268892+00:00 heroku[web.1]: Process exited with status 1
2016-10-11T19:51:52.894691+00:00 heroku[web.1]: Starting process with command `n
pm start`
2016-10-11T19:51:55.200670+00:00 app[web.1]:
2016-10-11T19:51:55.200685+00:00 app[web.1]: > loc8r#0.0.0 start /app
2016-10-11T19:51:55.200685+00:00 app[web.1]: > node ./bin/www
2016-10-11T19:51:55.200686+00:00 app[web.1]:
2016-10-11T19:51:55.471950+00:00 app[web.1]: module.js:327
2016-10-11T19:51:55.471963+00:00 app[web.1]: throw err;
2016-10-11T19:51:55.471963+00:00 app[web.1]: ^
2016-10-11T19:51:55.471967+00:00 app[web.1]:
2016-10-11T19:51:55.471967+00:00 app[web.1]: Error: Cannot find module '../contr
ollers/main'
2016-10-11T19:51:55.471968+00:00 app[web.1]: at Function.Module._resolveFile
name (module.js:325:15)
2016-10-11T19:51:55.471968+00:00 app[web.1]: at Function.Module._load (modul
e.js:276:25)
2016-10-11T19:51:55.471969+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:55.471969+00:00 app[web.1]: at require (internal/module.js:
12:17)
2016-10-11T19:51:55.471970+00:00 app[web.1]: at Object.<anonymous> (/app/app
_server/routes/index.js:3:17)
2016-10-11T19:51:55.471971+00:00 app[web.1]: at Module._compile (module.js:4
09:26)
2016-10-11T19:51:55.471971+00:00 app[web.1]: at Object.Module._extensions..j
s (module.js:416:10)
2016-10-11T19:51:55.471972+00:00 app[web.1]: at Module.load (module.js:343:3
2)
2016-10-11T19:51:55.471972+00:00 app[web.1]: at Function.Module._load (modul
e.js:300:12)
2016-10-11T19:51:55.471973+00:00 app[web.1]: at Module.require (module.js:35
3:17)
2016-10-11T19:51:55.481097+00:00 app[web.1]:
2016-10-11T19:51:55.487850+00:00 app[web.1]: npm ERR! Linux 3.13.0-95-generic
2016-10-11T19:51:55.488249+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bi
n/node" "/app/.heroku/node/bin/npm" "start"
2016-10-11T19:51:55.489769+00:00 app[web.1]: npm ERR! node v4.5.0
2016-10-11T19:51:55.489771+00:00 app[web.1]: npm ERR! npm v2.15.11
2016-10-11T19:51:55.489771+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-10-11T19:51:55.489772+00:00 app[web.1]: npm ERR! loc8r#0.0.0 start: `node .
/bin/www`
2016-10-11T19:51:55.489773+00:00 app[web.1]: npm ERR! Exit status 1
2016-10-11T19:51:55.489897+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:55.490059+00:00 app[web.1]: npm ERR! Failed at the loc8r#0.0.0
start script 'node ./bin/www'.
2016-10-11T19:51:55.490228+00:00 app[web.1]: npm ERR! This is most likely a prob
lem with the loc8r package,
2016-10-11T19:51:55.490384+00:00 app[web.1]: npm ERR! not with npm itself.
2016-10-11T19:51:55.490534+00:00 app[web.1]: npm ERR! Tell the author that this
fails on your system:
2016-10-11T19:51:55.490692+00:00 app[web.1]: npm ERR! node ./bin/www
2016-10-11T19:51:55.490844+00:00 app[web.1]: npm ERR! You can get information on
how to open an issue for this project with:
2016-10-11T19:51:55.491004+00:00 app[web.1]: npm ERR! npm bugs loc8r
2016-10-11T19:51:55.491156+00:00 app[web.1]: npm ERR! Or if that isn't available
, you can get their info via:
2016-10-11T19:51:55.491308+00:00 app[web.1]: npm ERR!
2016-10-11T19:51:55.491457+00:00 app[web.1]: npm ERR! npm owner ls loc8r
2016-10-11T19:51:55.491613+00:00 app[web.1]: npm ERR! There is likely additional
logging output above.
2016-10-11T19:51:55.495210+00:00 app[web.1]:
2016-10-11T19:51:55.495590+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-10-11T19:51:55.495442+00:00 app[web.1]: npm ERR! Please include the followi
ng file with any support request:
2016-10-11T19:51:55.601435+00:00 heroku[web.1]: State changed from starting to c
rashed
2016-10-11T19:51:55.580900+00:00 heroku[web.1]: Process exited with status 1
2016-10-11T19:57:39.619644+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=fast-plains-12113.herokuapp.com request_id=6d440a
4e-993d-4676-ae41-939426ff1ffd fwd="2.83.58.24" dyno= connect= service= status=5
03 bytes=
2016-10-11T19:57:40.240525+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=fast-plains-12113.herokuapp.com reques
t_id=c5caca51-92c0-4532-b56c-6f060cd39634 fwd="2.83.58.24" dyno= connect= servic
e= status=503 bytes=
2016-10-11T20:00:42.624338+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=fast-plains-12113.herokuapp.com request_id=ef7dc9
6d-920b-4a4c-ae7a-9ccb584b1682 fwd="2.83.58.24" dyno= connect= service= status=5
03 bytes=
2016-10-11T20:00:42.771815+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=fast-plains-12113.herokuapp.com reques
t_id=50598f55-4a3e-4b30-ac54-e77a722fb839 fwd="2.83.58.24" dyno= connect= servic
e= status=503 bytes=
2016-10-11T20:03:25.808113+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/" host=fast-plains-12113.herokuapp.com request_id=9e2da8
b4-e936-4812-93a7-378ec78606f8 fwd="2.83.58.24" dyno= connect= service= status=5
03 bytes=
2016-10-11T20:03:25.961352+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path="/favicon.ico" host=fast-plains-12113.herokuapp.com reques
t_id=5d95a945-dcfa-4248-981d-11ce2f764b56 fwd="2.83.58.24" dyno= connect= servic
e= status=503 bytes=

Resources