I am trying to deploy my application on Heroku, but it is showing following error
"We're sorry, but something went wrong."
So I've check my heroku logs, here is 2 problems I have
2019-05-22T13:56:04.512197+00:00 heroku[router]: at=info method=GET path="/" host=concierge-at-sea.herokuapp.com request_id=4f5fe5ef-ab45-4012-97be-87de88b8fdb5 fwd="89.95.71.184" dyno=web.1 connect=0ms service=1496ms status=500 bytes=1827 protocol=https
2019-05-22T13:55:35.566494+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2019-05-22T13:55:35.686117+00:00 heroku[web.1]: Process exited with status 143
This is for an app with devise, I've already tried heroku restart in order to restart my dyno's
But I don't understand the error 500, in local everything works
Here is my heroku logs
2019-05-22T13:53:09.716085+00:00 app[web.1]: ],
2019-05-22T13:53:09.716086+00:00 app[web.1]: "js.map": [
2019-05-22T13:53:09.716087+00:00 app[web.1]: "/packs/js/application-b9d827093751ba55443e.js.map"
2019-05-22T13:53:09.716089+00:00 app[web.1]: ]
2019-05-22T13:53:09.716090+00:00 app[web.1]: },
2019-05-22T13:53:09.716091+00:00 app[web.1]: "map": {
2019-05-22T13:53:09.716093+00:00 app[web.1]: "css": [
2019-05-22T13:53:09.716094+00:00 app[web.1]: "/packs/css/map-1c42ce8f.css"
2019-05-22T13:53:09.716096+00:00 app[web.1]: ],
2019-05-22T13:53:09.716097+00:00 app[web.1]: "js": [
2019-05-22T13:53:09.716098+00:00 app[web.1]: "/packs/js/map-c76722abf103111664a2.js"
2019-05-22T13:53:09.716100+00:00 app[web.1]: ],
2019-05-22T13:53:09.716101+00:00 app[web.1]: "js.map": [
2019-05-22T13:53:09.716102+00:00 app[web.1]: "/packs/js/map-c76722abf103111664a2.js.map"
2019-05-22T13:53:09.716104+00:00 app[web.1]: ]
2019-05-22T13:53:09.716105+00:00 app[web.1]: }
2019-05-22T13:53:09.716106+00:00 app[web.1]: },
2019-05-22T13:53:09.716108+00:00 app[web.1]: "map.css": "/packs/css/map-1c42ce8f.css",
2019-05-22T13:53:09.716109+00:00 app[web.1]: "map.js": "/packs/js/map-c76722abf103111664a2.js",
2019-05-22T13:53:09.716110+00:00 app[web.1]: "map.js.map": "/packs/js/map-c76722abf103111664a2.js.map"
2019-05-22T13:53:09.716112+00:00 app[web.1]: }
2019-05-22T13:53:09.716113+00:00 app[web.1]: ):
2019-05-22T13:53:09.716334+00:00 app[web.1]: F, [2019-05-22T13:53:09.716276 #4] FATAL -- : [20ca8723-7451-41e8-ab0d-df5b3e56c777] 7: <%= csrf_meta_tags %>
2019-05-22T13:53:09.716337+00:00 app[web.1]: [20ca8723-7451-41e8-ab0d-df5b3e56c777] 8: <%= action_cable_meta_tag %>
2019-05-22T13:53:09.716338+00:00 app[web.1]: [20ca8723-7451-41e8-ab0d-df5b3e56c777] 9: <%= stylesheet_link_tag 'application', media: 'all' %>
2019-05-22T13:53:09.716340+00:00 app[web.1]: [20ca8723-7451-41e8-ab0d-df5b3e56c777] 10: <%= stylesheet_pack_tag 'application', media: 'all' %>
2019-05-22T13:53:09.716341+00:00 app[web.1]: [20ca8723-7451-41e8-ab0d-df5b3e56c777] 11: <%= stylesheet_pack_tag 'map' %>
2019-05-22T13:53:09.716343+00:00 app[web.1]: [20ca8723-7451-41e8-ab0d-df5b3e56c777] 12: </head>
2019-05-22T13:53:09.716344+00:00 app[web.1]: [20ca8723-7451-41e8-ab0d-df5b3e56c777] 13: <body>
2019-05-22T13:53:09.716426+00:00 app[web.1]: F, [2019-05-22T13:53:09.716369 #4] FATAL -- : [20ca8723-7451-41e8-ab0d-df5b3e56c777]
2019-05-22T13:53:09.716517+00:00 app[web.1]: F, [2019-05-22T13:53:09.716463 #4] FATAL -- : [20ca8723-7451-41e8-ab0d-df5b3e56c777] app/views/layouts/application.html.erb:10:in `_app_views_layouts_application_html_erb___4054649697818533831_47054766793720'
2019-05-22T13:55:34.396458+00:00 heroku[web.1]: Restarting
2019-05-22T13:55:34.681019+00:00 heroku[web.1]: State changed from up to starting
2019-05-22T13:55:35.566494+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2019-05-22T13:55:35.686117+00:00 heroku[web.1]: Process exited with status 143
2019-05-22T13:55:35.579278+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2019-05-22T13:55:35.582846+00:00 app[web.1]: === puma shutdown: 2019-05-22 13:55:35 +0000 ===
2019-05-22T13:55:35.582878+00:00 app[web.1]: - Goodbye!
2019-05-22T13:55:41.287394+00:00 heroku[web.1]: Starting process with command `bundle exec puma -C config/puma.rb`
2019-05-22T13:55:43.390424+00:00 app[web.1]: Puma starting in single mode...
2019-05-22T13:55:43.390453+00:00 app[web.1]: * Version 3.12.1 (ruby 2.5.3-p105), codename: Llamas in Pajamas
2019-05-22T13:55:43.390455+00:00 app[web.1]: * Min threads: 5, max threads: 5
2019-05-22T13:55:43.390456+00:00 app[web.1]: * Environment: production
2019-05-22T13:55:45.981837+00:00 heroku[web.1]: State changed from starting to up
2019-05-22T13:55:45.842400+00:00 app[web.1]: * Listening on tcp://0.0.0.0:21575
2019-05-22T13:55:45.842712+00:00 app[web.1]: Use Ctrl-C to stop
2019-05-22T13:56:03.019885+00:00 app[web.1]: I, [2019-05-22T13:56:03.019766 #4] INFO -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] Started GET "/" for 89.95.71.184 at 2019-05-22 13:56:03 +0000
2019-05-22T13:56:03.021420+00:00 app[web.1]: I, [2019-05-22T13:56:03.021348 #4] INFO -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] Processing by Devise::SessionsController#new as HTML
2019-05-22T13:56:03.112359+00:00 app[web.1]: I, [2019-05-22T13:56:03.112174 #4] INFO -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] Rendering devise/sessions/new.html.erb within layouts/application
2019-05-22T13:56:04.512197+00:00 heroku[router]: at=info method=GET path="/" host=concierge-at-sea.herokuapp.com request_id=4f5fe5ef-ab45-4012-97be-87de88b8fdb5 fwd="89.95.71.184" dyno=web.1 connect=0ms service=1496ms status=500 bytes=1827 protocol=https
2019-05-22T13:56:04.509151+00:00 app[web.1]: I, [2019-05-22T13:56:04.509056 #4] INFO -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] Rendered devise/shared/_links.html.erb (1.1ms)
2019-05-22T13:56:04.509685+00:00 app[web.1]: I, [2019-05-22T13:56:04.509622 #4] INFO -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] Rendered devise/sessions/new.html.erb within layouts/application (1397.3ms)
2019-05-22T13:56:04.511523+00:00 app[web.1]: I, [2019-05-22T13:56:04.511465 #4] INFO -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] Completed 500 Internal Server Error in 1490ms (ActiveRecord: 17.4ms)
2019-05-22T13:56:04.512104+00:00 app[web.1]: F, [2019-05-22T13:56:04.512053 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5]
2019-05-22T13:56:04.512180+00:00 app[web.1]: F, [2019-05-22T13:56:04.512116 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] ActionView::Template::Error (Webpacker can't find application in /app/public/packs/manifest.json. Possible causes:
2019-05-22T13:56:04.512182+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment
2019-05-22T13:56:04.512183+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server.
2019-05-22T13:56:04.512184+00:00 app[web.1]: 2. webpack has not yet re-run to reflect updates.
2019-05-22T13:56:04.512185+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
2019-05-22T13:56:04.512186+00:00 app[web.1]: 4. Your webpack configuration is not creating a manifest.
2019-05-22T13:56:04.512188+00:00 app[web.1]: Your manifest contains:
2019-05-22T13:56:04.512189+00:00 app[web.1]: {
2019-05-22T13:56:04.512190+00:00 app[web.1]: "application.js": "/packs/js/application-b9d827093751ba55443e.js",
2019-05-22T13:56:04.512192+00:00 app[web.1]: "application.js.map": "/packs/js/application-b9d827093751ba55443e.js.map",
2019-05-22T13:56:04.512193+00:00 app[web.1]: "entrypoints": {
2019-05-22T13:56:04.512194+00:00 app[web.1]: "application": {
2019-05-22T13:56:04.512195+00:00 app[web.1]: "js": [
2019-05-22T13:56:04.512196+00:00 app[web.1]: "/packs/js/application-b9d827093751ba55443e.js"
2019-05-22T13:56:04.512197+00:00 app[web.1]: ],
2019-05-22T13:56:04.512198+00:00 app[web.1]: "js.map": [
2019-05-22T13:56:04.512199+00:00 app[web.1]: "/packs/js/application-b9d827093751ba55443e.js.map"
2019-05-22T13:56:04.512200+00:00 app[web.1]: ]
2019-05-22T13:56:04.512201+00:00 app[web.1]: },
2019-05-22T13:56:04.512202+00:00 app[web.1]: "map": {
2019-05-22T13:56:04.512203+00:00 app[web.1]: "css": [
2019-05-22T13:56:04.512204+00:00 app[web.1]: "/packs/css/map-1c42ce8f.css"
2019-05-22T13:56:04.512205+00:00 app[web.1]: ],
2019-05-22T13:56:04.512206+00:00 app[web.1]: "js": [
2019-05-22T13:56:04.512207+00:00 app[web.1]: "/packs/js/map-c76722abf103111664a2.js"
2019-05-22T13:56:04.512208+00:00 app[web.1]: ],
2019-05-22T13:56:04.512209+00:00 app[web.1]: "js.map": [
2019-05-22T13:56:04.512210+00:00 app[web.1]: "/packs/js/map-c76722abf103111664a2.js.map"
2019-05-22T13:56:04.512211+00:00 app[web.1]: ]
2019-05-22T13:56:04.512212+00:00 app[web.1]: }
2019-05-22T13:56:04.512213+00:00 app[web.1]: },
2019-05-22T13:56:04.512214+00:00 app[web.1]: "map.css": "/packs/css/map-1c42ce8f.css",
2019-05-22T13:56:04.512215+00:00 app[web.1]: "map.js": "/packs/js/map-c76722abf103111664a2.js",
2019-05-22T13:56:04.512217+00:00 app[web.1]: "map.js.map": "/packs/js/map-c76722abf103111664a2.js.map"
2019-05-22T13:56:04.512218+00:00 app[web.1]: }
2019-05-22T13:56:04.512219+00:00 app[web.1]: ):
2019-05-22T13:56:04.512299+00:00 app[web.1]: F, [2019-05-22T13:56:04.512257 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 7: <%= csrf_meta_tags %>
2019-05-22T13:56:04.512300+00:00 app[web.1]: [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 8: <%= action_cable_meta_tag %>
2019-05-22T13:56:04.512301+00:00 app[web.1]: [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 9: <%= stylesheet_link_tag 'application', media: 'all' %>
2019-05-22T13:56:04.512302+00:00 app[web.1]: [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 10: <%= stylesheet_pack_tag 'application', media: 'all' %>
2019-05-22T13:56:04.512303+00:00 app[web.1]: [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 11: <%= stylesheet_pack_tag 'map' %>
2019-05-22T13:56:04.512304+00:00 app[web.1]: [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 12: </head>
2019-05-22T13:56:04.512305+00:00 app[web.1]: [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] 13: <body>
2019-05-22T13:56:04.512334+00:00 app[web.1]: F, [2019-05-22T13:56:04.512299 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5]
2019-05-22T13:56:04.512374+00:00 app[web.1]: F, [2019-05-22T13:56:04.512340 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] app/views/layouts/application.html.erb:10:in `_app_views_layouts_application_html_erb__246445882644024882_47273754121400'```
My routes
Rails.application.routes.draw do
devise_for :users
get '/dashboard' => 'pages#dashboard'
devise_scope :user do
root to: "devise/sessions#new"
end
authenticated :user do
root 'pages#dashboard'
end
end
My Layouts
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Concierge#Sea</title>
<%= csrf_meta_tags %>
<%= action_cable_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= stylesheet_pack_tag 'application', media: 'all' %>
<%= stylesheet_pack_tag 'map' %>
</head>
<body>
<%= render 'shared/flyout' %>
<%= render 'shared/navbar' %>
<%= render 'shared/flashes' %>
<%= yield %>
<%= javascript_include_tag 'application' %>
<%= javascript_pack_tag 'application' %>
<%= javascript_pack_tag 'map' %>
</body>
</html>
Thanks you if you can help me or give me any advice
From your heroku logs looks like you have issues with webpacker. As you can see here
2019-05-22T13:56:04.512104+00:00 app[web.1]: F, [2019-05-22T13:56:04.512053 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5]
2019-05-22T13:56:04.512180+00:00 app[web.1]: F, [2019-05-22T13:56:04.512116 #4] FATAL -- : [4f5fe5ef-ab45-4012-97be-87de88b8fdb5] ActionView::Template::Error (Webpacker can't find application in /app/public/packs/manifest.json. Possible causes:
2019-05-22T13:56:04.512182+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment
2019-05-22T13:56:04.512183+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server.
2019-05-22T13:56:04.512184+00:00 app[web.1]: 2. webpack has not yet re-run to reflect updates.
2019-05-22T13:56:04.512185+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
2019-05-22T13:56:04.512186+00:00 app[web.1]: 4. Your webpack configuration is not creating a manifest.
Did you run webpacker:compile command on heroku?
Also based on info here https://github.com/rails/webpacker/issues/1494. There may be an issue with webpacker itself.
Related
My program crashes. the website does not even load for a second. It loads until the program crashes. I tried changing the JSON and the Procfile but nothing seems to work. I tried restarting Heroku and I have no env variables, but nothing worked though.
Here are the Heroku logs:
2023-02-05T23:53:55.000000+00:00 app[api]: Build succeeded
2023-02-05T23:54:01.544863+00:00 heroku[web.1]: Starting process with command `npm start`
2023-02-05T23:54:03.163211+00:00 app[web.1]:
2023-02-05T23:54:03.163238+00:00 app[web.1]: > modal-react#0.1.0 start /app
2023-02-05T23:54:03.163238+00:00 app[web.1]: > react-scripts start
2023-02-05T23:54:03.163239+00:00 app[web.1]:
2023-02-05T23:54:05.047020+00:00 heroku[web.1]: State changed from starting to up
2023-02-05T23:54:04.946662+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.18.62.238/
2023-02-05T23:54:04.946860+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2023-02-05T23:54:04.946902+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2023-02-05T23:54:04.946928+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2023-02-05T23:54:04.947288+00:00 app[web.1]: Starting the development server...
2023-02-05T23:54:04.947288+00:00 app[web.1]:
2023-02-05T23:54:36.531206+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=mymedicineislqatar.herokuapp.com request_id=39c2b9ef-437e-4436-ad00-3112613f8575 fwd="37.210.130.204" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https
2023-02-05T23:54:39.448024+00:00 app[web.1]:
2023-02-05T23:54:39.448049+00:00 app[web.1]: <--- Last few GCs --->
2023-02-05T23:54:39.448049+00:00 app[web.1]:
2023-02-05T23:54:39.448050+00:00 app[web.1]: [27:0x52a4a20] 35980 ms: Scavenge (reduce) 244.9 (256.0) -> 244.4 (257.3) MB, 0.6 / 0.0 ms (average mu = 0.769, current mu = 0.791) allocation failure
2023-02-05T23:54:39.448050+00:00 app[web.1]: [27:0x52a4a20] 35984 ms: Scavenge (reduce) 245.0 (256.3) -> 244.7 (257.5) MB, 0.6 / 0.0 ms (average mu = 0.769, current mu = 0.791) allocation failure
2023-02-05T23:54:39.448051+00:00 app[web.1]: [27:0x52a4a20] 35987 ms: Scavenge (reduce) 245.3 (256.5) -> 244.8 (257.8) MB, 0.5 / 0.0 ms (average mu = 0.769, current mu = 0.791) allocation failure
2023-02-05T23:54:39.448051+00:00 app[web.1]:
2023-02-05T23:54:39.448055+00:00 app[web.1]:
2023-02-05T23:54:39.448055+00:00 app[web.1]: <--- JS stacktrace --->
2023-02-05T23:54:39.448055+00:00 app[web.1]:
2023-02-05T23:54:39.448056+00:00 app[web.1]: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
2023-02-05T23:54:39.448844+00:00 app[web.1]: 1: 0xa24ed0 node::Abort() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.449459+00:00 app[web.1]: 2: 0x966115 node::FatalError(char const*, char const*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.450119+00:00 app[web.1]: 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.450762+00:00 app[web.1]: 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.451531+00:00 app[web.1]: 5: 0xd56ea5 [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.452289+00:00 app[web.1]: 6: 0xd87a8e v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.453046+00:00 app[web.1]: 7: 0xd93ac6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.453790+00:00 app[web.1]: 8: 0xd7fc5f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.454550+00:00 app[web.1]: 9: 0xd7fed8 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.455206+00:00 app[web.1]: 10: 0xd727b9 v8::internal::ItemParallelJob::Run() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.455880+00:00 app[web.1]: 11: 0xd95a20 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.456513+00:00 app[web.1]: 12: 0xd962bc v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.457199+00:00 app[web.1]: 13: 0xd96485 v8::internal::MarkCompactCollector::Evacuate() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.457819+00:00 app[web.1]: 14: 0xda8481 v8::internal::MarkCompactCollector::CollectGarbage() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.458407+00:00 app[web.1]: 15: 0xd64748 v8::internal::Heap::MarkCompact() [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.459057+00:00 app[web.1]: 16: 0xd66238 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.459755+00:00 app[web.1]: 17: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.460492+00:00 app[web.1]: 18: 0xd2ee1d v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.461168+00:00 app[web.1]: 19: 0xd2b079 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.461776+00:00 app[web.1]: 20: 0xd2b134 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::Oddball>, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.462477+00:00 app[web.1]: 21: 0xf6d5af v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::CollectKeysTo(v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::KeyAccumulator*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.463220+00:00 app[web.1]: 22: 0xf2753b v8::internal::KeyAccumulator::CollectOwnPropertyNames(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.463897+00:00 app[web.1]: 23: 0xf2790f v8::internal::KeyAccumulator::CollectOwnKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSObject>) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.464596+00:00 app[web.1]: 24: 0xf28781 v8::internal::KeyAccumulator::CollectKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::JSReceiver>) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.465376+00:00 app[web.1]: 25: 0xf28edc v8::internal::FastKeyAccumulator::GetKeysSlow(v8::internal::GetKeysConversion) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.466182+00:00 app[web.1]: 26: 0xf29031 v8::internal::KeyAccumulator::GetKeys(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::KeyCollectionMode, v8::internal::PropertyFilter, v8::internal::GetKeysConversion, bool, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.466983+00:00 app[web.1]: 27: 0xf177b3 v8::internal::JSReceiver::SetOrCopyDataProperties(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::ScopedVector<v8::internal::Handle<v8::internal::Object> > const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.467718+00:00 app[web.1]: 28: 0x1098060 v8::internal::Runtime_SetDataProperties(int, unsigned long*, v8::internal::Isolate*) [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.468516+00:00 app[web.1]: 29: 0x1427099 [/app/.heroku/node/bin/node]
2023-02-05T23:54:39.495089+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2023-02-05T23:54:39.495260+00:00 app[web.1]: npm ERR! errno 1
2023-02-05T23:54:39.497846+00:00 app[web.1]: npm ERR! modal-react#0.1.0 start: `react-scripts start`
2023-02-05T23:54:39.497902+00:00 app[web.1]: npm ERR! Exit status 1
2023-02-05T23:54:39.497966+00:00 app[web.1]: npm ERR!
2023-02-05T23:54:39.498018+00:00 app[web.1]: npm ERR! Failed at the modal-react#0.1.0 start script.
2023-02-05T23:54:39.498066+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-02-05T23:54:39.504341+00:00 app[web.1]:
2023-02-05T23:54:39.504445+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2023-02-05T23:54:39.504504+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2023-02-05T23_54_39_498Z-debug.log
2023-02-05T23:54:39.629101+00:00 heroku[web.1]: Process exited with status 1
2023-02-05T23:54:39.489515+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/favicon.ico" host=mymedicineislqatar.herokuapp.com request_id=f91207ad-031d-45e5-8b63-bdb0b7dff9a6 fwd="37.210.130.204" dyno=web.1 connect=0ms service=2512ms status=503 bytes=0 protocol=https
2023-02-05T23:54:39.701388+00:00 heroku[web.1]: State changed from up to crashed
2023-02-05T23:54:39.706529+00:00 heroku[web.1]: State changed from crashed to starting
2023-02-05T23:54:49.290975+00:00 heroku[web.1]: Starting process with command `npm start`
2023-02-05T23:54:50.883106+00:00 app[web.1]:
2023-02-05T23:54:50.883138+00:00 app[web.1]: > modal-react#0.1.0 start /app
2023-02-05T23:54:50.883140+00:00 app[web.1]: > react-scripts start
2023-02-05T23:54:50.883140+00:00 app[web.1]:
2023-02-05T23:54:52.657245+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Project is running at http://172.18.245.202/
2023-02-05T23:54:52.657424+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: webpack output is served from
2023-02-05T23:54:52.657465+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: Content not from webpack is served from /app/public
2023-02-05T23:54:52.657494+00:00 app[web.1]: [34mℹ[39m [90m「wds」[39m: 404s will fallback to /
2023-02-05T23:54:52.657852+00:00 app[web.1]: Starting the development server...
2023-02-05T23:54:52.657853+00:00 app[web.1]:
2023-02-05T23:54:53.193812+00:00 heroku[web.1]: State changed from starting to up
2023-02-05T23:55:28.206144+00:00 app[web.1]:
2023-02-05T23:55:28.206176+00:00 app[web.1]: <--- Last few GCs --->
2023-02-05T23:55:28.206176+00:00 app[web.1]:
2023-02-05T23:55:28.206178+00:00 app[web.1]: [27:0x5606a20] 36994 ms: Scavenge (reduce) 245.1 (256.3) -> 244.5 (257.5) MB, 0.6 / 0.0 ms (average mu = 0.779, current mu = 0.780) allocation failure
2023-02-05T23:55:28.206179+00:00 app[web.1]: [27:0x5606a20] 37008 ms: Scavenge (reduce) 245.4 (256.5) -> 244.9 (257.5) MB, 0.9 / 0.0 ms (average mu = 0.779, current mu = 0.780) allocation failure
2023-02-05T23:55:28.206179+00:00 app[web.1]: [27:0x5606a20] 37019 ms: Scavenge (reduce) 245.7 (256.5) -> 245.2 (257.8) MB, 1.0 / 0.0 ms (average mu = 0.779, current mu = 0.780) allocation failure
2023-02-05T23:55:28.206179+00:00 app[web.1]:
2023-02-05T23:55:28.206184+00:00 app[web.1]:
2023-02-05T23:55:28.206184+00:00 app[web.1]: <--- JS stacktrace --->
2023-02-05T23:55:28.206185+00:00 app[web.1]:
2023-02-05T23:55:28.206201+00:00 app[web.1]: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
2023-02-05T23:55:28.206802+00:00 app[web.1]: 1: 0xa24ed0 node::Abort() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.207254+00:00 app[web.1]: 2: 0x966115 node::FatalError(char const*, char const*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.207773+00:00 app[web.1]: 3: 0xb9acde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.208271+00:00 app[web.1]: 4: 0xb9b057 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.208861+00:00 app[web.1]: 5: 0xd56ea5 [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.209460+00:00 app[web.1]: 6: 0xd87a8e v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.210082+00:00 app[web.1]: 7: 0xd93ac6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.210681+00:00 app[web.1]: 8: 0xd7fc5f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.211286+00:00 app[web.1]: 9: 0xd7fed8 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.211906+00:00 app[web.1]: 10: 0xd727b9 v8::internal::ItemParallelJob::Run() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.212496+00:00 app[web.1]: 11: 0xd95a20 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.213095+00:00 app[web.1]: 12: 0xd962bc v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.213693+00:00 app[web.1]: 13: 0xd96485 v8::internal::MarkCompactCollector::Evacuate() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.214312+00:00 app[web.1]: 14: 0xda8481 v8::internal::MarkCompactCollector::CollectGarbage() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.214903+00:00 app[web.1]: 15: 0xd64748 v8::internal::Heap::MarkCompact() [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.215517+00:00 app[web.1]: 16: 0xd66238 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.216130+00:00 app[web.1]: 17: 0xd6967c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.216707+00:00 app[web.1]: 18: 0xd2ee1d v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.217290+00:00 app[web.1]: 19: 0xd28ca4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.217888+00:00 app[web.1]: 20: 0xd2acb0 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.218557+00:00 app[web.1]: 21: 0xf8d18a v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.219204+00:00 app[web.1]: 22: 0xf90565 v8::internal::String::SlowEquals(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.219901+00:00 app[web.1]: 23: 0x10be8b7 v8::internal::Runtime_StringEqual(int, unsigned long*, v8::internal::Isolate*) [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.220642+00:00 app[web.1]: 24: 0x1427099 [/app/.heroku/node/bin/node]
2023-02-05T23:55:28.248461+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2023-02-05T23:55:28.248625+00:00 app[web.1]: npm ERR! errno 1
2023-02-05T23:55:28.251223+00:00 app[web.1]: npm ERR! modal-react#0.1.0 start: `react-scripts start`
2023-02-05T23:55:28.251271+00:00 app[web.1]: npm ERR! Exit status 1
2023-02-05T23:55:28.251326+00:00 app[web.1]: npm ERR!
2023-02-05T23:55:28.251371+00:00 app[web.1]: npm ERR! Failed at the modal-react#0.1.0 start script.
2023-02-05T23:55:28.251410+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2023-02-05T23:55:28.256461+00:00 app[web.1]:
2023-02-05T23:55:28.256545+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2023-02-05T23:55:28.256587+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2023-02-05T23_55_28_251Z-debug.log
2023-02-05T23:55:28.387360+00:00 heroku[web.1]: Process exited with status 1
2023-02-05T23:55:28.242228+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=mymedicineislqatar.herokuapp.com request_id=37e088cf-76a2-4ddf-803a-fa544c8aa355 fwd="37.210.130.204" dyno=web.1 connect=0ms service=19863ms status=503 bytes=0 protocol=https
2023-02-05T23:55:28.433328+00:00 heroku[web.1]: State changed from up to crashed
2023-02-05T23:55:33.626857+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mymedicineislqatar.herokuapp.com request_id=068075b9-bb44-4c91-8f0b-0cba807c2d87 fwd="37.210.130.204" dyno=web.1 connect=5002ms service= status=503 bytes= protocol=https
package.json file:
{
"name": "modal-react",
"version": "0.1.0",
"engines": {
"node": "14.17.1"
},
"private": true,
"dependencies": {
"#fontsource/manrope": "^4.5.11",
"#material-ui/core": "^4.11.4",
"#material-ui/icons": "^4.11.2",
"#testing-library/jest-dom": "^5.11.4",
"#testing-library/react": "^11.1.0",
"#testing-library/user-event": "^12.1.10",
"i": "^0.3.7",
"install": "^0.13.0",
"lightbox.js-react": "^0.3.3",
"npm": "^8.18.0",
"react": "^17.0.2",
"react-animated-slider": "^1.1.4",
"react-dom": "^17.0.2",
"react-icons": "^4.4.0",
"react-image-file-resizer": "^0.4.8",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
"react-slideshow-image": "^4.1.0",
"react-smart-slider": "^0.1.2",
"styled-components": "^5.3.5",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"nodemon": "^2.0.20"
}
}
Procfile:
web:npm start
I have a NodeJS app, with EJS as the templating engine, and when I deploy to Heroku I'm getting an internal server error. Here are the logs:
2022-01-20T13:30:24.000000+00:00 app[api]: Build started by user tylerdukedev#gmail.com
2022-01-20T13:30:44.605827+00:00 app[api]: Release v18 created by user tylerdukedev#gmail.com
2022-01-20T13:30:44.605827+00:00 app[api]: Deploy 82e13b43 by user tylerdukedev#gmail.com
2022-01-20T13:30:45.000000+00:00 app[api]: Build succeeded
2022-01-20T13:30:45.206696+00:00 heroku[web.1]: Restarting
2022-01-20T13:30:45.219319+00:00 heroku[web.1]: State changed from up to starting
2022-01-20T13:30:45.973448+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2022-01-20T13:30:46.136388+00:00 heroku[web.1]: Process exited with status 143
2022-01-20T13:30:48.058009+00:00 heroku[web.1]: Starting process with command `npm start`
2022-01-20T13:30:50.044342+00:00 app[web.1]:
2022-01-20T13:30:50.115141+00:00 app[web.1]: > food-blog#1.0.0 start /app
2022-01-20T13:30:50.115144+00:00 app[web.1]: > node app.js
2022-01-20T13:30:50.115144+00:00 app[web.1]:
2022-01-20T13:30:50.762969+00:00 app[web.1]: Listening on 47634
2022-01-20T13:30:51.003784+00:00 app[web.1]: Connected to MongoDB
2022-01-20T13:30:51.195440+00:00 heroku[web.1]: State changed from starting to up
2022-01-20T13:30:54.911676+00:00 heroku[router]: at=info method=GET path="/" host=food-blog-tdukedev.herokuapp.com request_id=d02d86c4-86b2-4e44-81c8-83467c04f03d fwd="73.129.233.103" dyno=web.1 connect=0ms service=74ms status=500 bytes=404 protocol=https
2022-01-20T13:30:54.917473+00:00 app[web.1]: TypeError: /app/server/views/index.ejs:132
2022-01-20T13:30:54.917479+00:00 app[web.1]: 130| <div class="card-body p-4">
2022-01-20T13:30:54.917481+00:00 app[web.1]: 131| <div class="badge bg-primary bg-gradient rounded-pill mb-2" id="cat-1">
2022-01-20T13:30:54.917482+00:00 app[web.1]: >> 132| <%= entries.at(-1).category %>
2022-01-20T13:30:54.917482+00:00 app[web.1]: 133| </div>
2022-01-20T13:30:54.917483+00:00 app[web.1]: 134| <a class="text-decoration-none link-dark stretched-link" href="#!">
2022-01-20T13:30:54.917483+00:00 app[web.1]: 135| <h5 class="card-title mb-3 animate__animated" id="title-1">
2022-01-20T13:30:54.917483+00:00 app[web.1]:
2022-01-20T13:30:54.917484+00:00 app[web.1]: entries.at is not a function
2022-01-20T13:30:54.917484+00:00 app[web.1]: at eval (eval at compile (/app/node_modules/ejs/lib/ejs.js:662:12), <anonymous>:12:34)
2022-01-20T13:30:54.917485+00:00 app[web.1]: at index (/app/node_modules/ejs/lib/ejs.js:692:17)
2022-01-20T13:30:54.917485+00:00 app[web.1]: at tryHandleCache (/app/node_modules/ejs/lib/ejs.js:272:36)
2022-01-20T13:30:54.917486+00:00 app[web.1]: at View.exports.renderFile [as engine] (/app/node_modules/ejs/lib/ejs.js:489:10)
2022-01-20T13:30:54.917486+00:00 app[web.1]: at View.render (/app/node_modules/express/lib/view.js:135:8)
2022-01-20T13:30:54.917486+00:00 app[web.1]: at tryRender (/app/node_modules/express/lib/application.js:640:10)
2022-01-20T13:30:54.917486+00:00 app[web.1]: at Function.render (/app/node_modules/express/lib/application.js:592:3)
2022-01-20T13:30:54.917487+00:00 app[web.1]: at ServerResponse.render (/app/node_modules/express/lib/response.js:1017:7)
2022-01-20T13:30:54.917487+00:00 app[web.1]: at ServerResponse.res.render (/app/node_modules/express-ejs-layouts/lib/express-layouts.js:77:18)
2022-01-20T13:30:54.917488+00:00 app[web.1]: at exports.homepage (/app/server/controllers/homepageController.js:6:15)
entries.at is pulling from a MongoDB database with Mongoose, it's populating data from the db.
I've tried to set the views directory to be relative and absolute (per an SO question/answer), and that didn't work.
Here's what entries references:
homepageController.js:
// get home page ('index');
const Entry = require("../models/posts");
exports.homepage = async(req,res) => {
let entries = await Entry.find({})
await res.render('index', {
title: 'Food Blog | Tyler Duke Dev',
entries
});
};
the model:
const mongoose = require('mongoose');
const entrySchema = new mongoose.Schema({
category: {
type: String,
required: true
},
title: {
type: String,
required: true
},
desc: {
type: String,
required: true
},
author: {
type: String,
required: true
},
dateCreated: {
type: Date,
required: true
},
readTime: {
type: String,
required: true
}
})
const Entry = mongoose.model('Entry', entrySchema);
module.exports = Entry;
I'm trying to deploy my ecommerce nuxt app to heroku. Here's exactly what I did
heroku create myapplok
heroku buildpacks:set heroku/nodejs -a myapplok
heroku config:set HOST=0.0.0.0 -a myapplok
/// everything works fine
then
$ git init
$ heroku git:remote -a myapplok
$ git add .
$ git commit -am "make it better"
$ git push heroku master
I followed exactly what the heroku website did list. Everything works
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Pruning devDependencies
remote: removed 61 packages and audited 1552 packages in 10.915s
remote:
remote: 80 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 991 vulnerabilities (2 low, 294 moderate, 694 high, 1 critical)
remote: run `npm audit fix` to fix them, or `npm audit` for details
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 305.4M
remote: -----> Launching...
remote: ! Warning: Your slug size (305 MB) exceeds our soft limit (300 MB) which may affect boot time.
remote: Released v6
remote: https://myapplok.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/myapplok.git
9cca5b7d..2e1cd57d master -> master
Once I visit the link, however, I get an error:
After following the heroku tail command, the app keeps crashing with the following error
2021-09-06T09:39:31.000000+00:00 app[api]: Build succeeded
2021-09-06T09:39:33.604061+00:00 heroku[web.1]: Starting process with command `: nuxt start`
2021-09-06T09:39:35.640203+00:00 heroku[web.1]: Process exited with status 0
2021-09-06T09:39:35.707305+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-06T09:39:35.716203+00:00 heroku[web.1]: State changed from crashed to starting
2021-09-06T09:39:48.890905+00:00 heroku[web.1]: Starting process with command `: nuxt start`
2021-09-06T09:39:51.075210+00:00 heroku[web.1]: Process exited with status 0
2021-09-06T09:39:51.245879+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-06T09:39:52.472722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myapplok.herokuapp.com request_id=b15eba30-cc5b-4d9c-9bf1-293ae69e017d fwd="197.115.205.238" dyno= connect= service= status=503 bytes= protocol=https
Now i know that this problem has already been solved with this command in my nuxt config app
server: {
port: process.env.PORT || 4002,
},
I did add the process.env.port command but I'm still getting this error.
my nuxt config file
export default {
ssr: false,
head: {
titleTemplate: 'Lokazz',
title: 'Lokazz',
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
},
{
hid: 'description',
name: 'description',
content:
'Lokazz'
}
],
link: [
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700&subset=latin-ext'
}
]
},
css: [
'swiper/dist/css/swiper.css',
'~/static/fonts/Linearicons/Font/demo-files/demo.css',
'~/static/fonts/font-awesome/css/font-awesome.css',
'~/static/css/bootstrap.min.css',
'~/assets/scss/style.scss'
],
plugins: [
{ src: '~plugins/vueliate.js', ssr: false },
{ src: '~/plugins/swiper-plugin.js', ssr: false },
{ src: '~/plugins/vue-notification.js', ssr: false },
{ src: '~/plugins/axios.js'},
{ src: '~/plugins/lazyLoad.js', ssr: false },
{ src: '~/plugins/mask.js', ssr: false },
{ src: '~/plugins/toastr.js', ssr: false },
],
buildModules: [
'#nuxtjs/vuetify',
'#nuxtjs/style-resources',
'cookie-universal-nuxt'
],
styleResources: {
scss: './assets/scss/env.scss'
},
modules: ['#nuxtjs/axios', 'nuxt-i18n','vue-sweetalert2/nuxt', '#nuxtjs/auth-next', "bootstrap-vue/nuxt"],
bootstrapVue: {
bootstrapCSS: false, // here you can disable automatic bootstrapCSS in case you are loading it yourself using sass
bootstrapVueCSS: false, // CSS that is specific to bootstrapVue components can also be disabled. That way you won't load css for modules that you don't use
},
i18n: {
locales: [
{ code: 'en', file: 'en.json' },
{ code: 'fr', file: 'fr.json' }
],
strategy: 'no_prefix',
fallbackLocale: 'en',
lazy: true,
defaultLocale: 'en',
langDir: 'lang/locales/'
},
router: {
linkActiveClass: '',
linkExactActiveClass: 'active',
},
server: {
port: process.env.PORT || 4002,
},
auth: {
strategies: {
local: {
token: {
property: "token",
global: true,
},
redirect: {
"login": "/account/login",
"logout": "/",
"home": "/page/ajouter-produit",
"callback": false
},
endpoints: {
login: { url: "http://localhost:5000/login", method: "post" },
logout: false, // we don't have an endpoint for our logout in our API and we just remove the token from localstorage
user:false
}
}
}
},
};
my package.json file
{
"name": "martfury_vue",
"version": "1.3.0",
"description": "Martfury - Multi-purpose Ecomerce template with vuejs",
"author": "nouthemes",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"heroku-postbuild" : " npm run build"
},
}
Remove heroku config:set HOST=0.0.0.0 -a myapplok
because your nuxt app runs in configured to run on localhost
I am having trouble deploying my Node.JS app to Heroku, I know it's the database that is causing the issue but can't work out why. I am led to believe that I need to use Mlab instead of MongoDB Atlas so I have now tried both and neither work. When I deploy and visit the url I get an error. Here are the logs:
2019-04-13T21:42:47.139176+00:00 app[web.1]: operationTime:
2019-04-13T21:42:47.139180+00:00 app[web.1]: Timestamp { _bsontype: 'Timestamp', low_: 2, high_: 1555191760 },
2019-04-13T21:42:47.139181+00:00 app[web.1]: '$clusterTime':
2019-04-13T21:42:47.139182+00:00 app[web.1]: { clusterTime:
2019-04-13T21:42:47.139183+00:00 app[web.1]: Timestamp { _bsontype: 'Timestamp', low_: 2, high_: 1555191760 },
2019-04-13T21:42:47.139184+00:00 app[web.1]: signature: { hash: [Binary], keyId: [Long] } },
2019-04-13T21:42:47.139185+00:00 app[web.1]: name: 'MongoError',
2019-04-13T21:42:47.139187+00:00 app[web.1]: [Symbol(mongoErrorContextSymbol)]: {} }
2019-04-13T21:42:47.880138+00:00 heroku[web.1]: State changed from starting to up
2019-04-13T21:43:19.726698+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=my-personal-blog16.herokuapp.com request_id=fa43cfdb-4704-4b0d-8de0-5d65604dd98f fwd="92.233.88.145" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https
Here is my URI for connecting to the DB:
require('dotenv').config();
const dbpass = process.env.DB_PASS;
const mlabpass = process.env.MLAB_PASS;
module.exports = {
MongoURI:
`mongodb://fishj123:${mlabpass}#ds149885.mlab.com:49885/heroku_26921dvn`,
};
Link to my git repo: https://github.com/fishj123/personal-blog
Would really appreciate any help.
For anyone having similar issues - I worked out what was wrong. I hadn't set my Global Variables within Heroku, I hadn't realized that this was necessary.
Setting the variables in Heroku is as easy as going to the Settings tab and then setting the variables under Config Variables.
I'm trying to deploy to Heroku and I am met with this error. I've done some research and tried uninstalling and reinstalling some gems after looking at relevant posts but I'm not really sure what's wrong here as I am not familiar with what the actual problem is. Please help! What should I do? So far I'm thinking it has something to do with the jquery.
ExecJS::ProgramError: Unexpected character '#' (line: 13912, col: 0, pos: 394110)
remote: Error
remote: at new JS_Parse_Error (/tmp/execjs20150204-1143-zrnj29js:2359:10623)
remote: at js_error (/tmp/execjs20150204-1143-zrnj29js:2359:10842)
remote: at parse_error (/tmp/execjs20150204-1143-zrnj29js:2359:12560)
remote: at Object.next_token [as input] (/tmp/execjs20150204-1143-zrnj29js:2359:17582)
remote: at next (/tmp/execjs20150204-1143-zrnj29js:2359:18900)
remote: at semicolon (/tmp/execjs20150204-1143-zrnj29js:2359:19745)
remote: at simple_statement (/tmp/execjs20150204-1143-zrnj29js:2359:22580)
remote: at /tmp/execjs20150204-1143-zrnj29js:2359:20708
remote: at /tmp/execjs20150204-1143-zrnj29js:2359:19957
remote: at /tmp/execjs20150204-1143-zrnj29js:2359:31968
remote: at Object.parse (/tmp/execjs20150204-1143-zrnj29js:2360:152)
remote: (in /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/app/assets/javascripts/application.js)/tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/execjs-2.2.2/lib/execjs/external_runtime.rb:64:in `extract_result'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/execjs-2.2.2/lib/execjs/external_runtime.rb:29:in `exec'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/uglifier-2.7.0/lib/uglifier.rb:200:in `run_uglifyjs'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/uglifier-2.7.0/lib/uglifier.rb:178:in `compile'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/uglifier_compressor.rb:25:in `evaluate'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:197:in `block in evaluate'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `each'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/context.rb:194:in `evaluate'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/bundled_asset.rb:25:in `initialize'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `new'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:377:in `build_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:94:in `block in build_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/caching.rb:58:in `cache_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:93:in `build_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/base.rb:287:in `find_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/index.rb:61:in `find_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:211:in `block in find_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:257:in `benchmark'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:210:in `find_asset'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:119:in `block in compile'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `each'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/sprockets/manifest.rb:118:in `compile'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.3/lib/rake/sprocketstask.rb:146:in `with_logger'
remote: /tmp/build_eb6f5cb07cab440eb52a1d47cb70ca23/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.2.2/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
gem file
source 'https://rubygems.org'
ruby '2.0.0'
gem 'rails', '4.2.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'bootstrap-sass', '~> 3.3.3'
gem 'autoprefixer-rails'
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
gem 'spring'
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
group :doc do
gem 'sdoc', '~> 0.4.0', require: false
end
/welcome.js
(function($) {
var $container = $(".parallax");
var $divs = $container.find("div.parallax-background");
var thingBeingScrolled = document.body;
var liHeight = $divs.eq(0).closest("li").height();
var diffHeight = $divs.eq(0).height() - liHeight;
var i,len,li,offset,scroll,top;
var render = function() {
top = thingBeingScrolled.scrollTop;
//loop through divs
for(i=0,len=$divs.length;i<len;i++) {
//get one div
div = $divs[i];
//get the parent LI
li = div.parentNode;
//calculate the offsetTOP of the div
offset = $(div).offset().top
//calculate the amount to scroll
scroll = Math.round(((top - offset)/liHeight) * diffHeight);
//apply scroll amount
div.style.webkitTransform = "translate3d(0px,"+scroll+"px,0px)";
}
};
(function loop(){
requestAnimationFrame(loop);
render();
})();
})(jQuery);
remove the comment line which is start with "#" from any of your .js file