Hi guys, First time using Solidus on a Rails proje...
# support
j
Hi guys, First time using Solidus on a Rails project. Everything is great so far in development, but it’s another thing in production. I can access everything, add my products etc...but nothing is rendered in front. I am using Heroku. If someone has been through this i ll be glad to take some advice 🙂
k
Hello! Do you have access to heroku logs to see if there’s a specific error when you reach the / page?
j
Yes nothing on the logs...
k
did you used the starter or classic frontend during the installation?
j
the starter
k
so to recap, you can see the admin panel at
/admin
but
/
doesn’t render anything with no new lines in the production logs?
j
Yes that’s correct
k
you should at least see the request for
/
in the logs
j
I Can enter the admin panel, add my product, my taximonies etc (and i can see them when i Spree::Product.all), but nothing is rendered in front
Do you want to see the logs ? There is no error (to me)
k
yes please
j
Copy code
2023-04-18T16:14:53.218988+00:00 heroku[router]: at=info method=GET path="/store" host=<http://damp-plateau-87939.herokuapp.com|damp-plateau-87939.herokuapp.com> request_id=06904ed8-3dd5-4d2d-83dc-96d43897518c fwd="88.172.57.6" dyno=web.1 connect=0ms service=93ms status=200 bytes=9284 protocol=https
2023-04-18T16:14:53.127630+00:00 app[web.1]: I, [2023-04-18T16:14:53.127551 #2]  INFO -- : [06904ed8-3dd5-4d2d-83dc-96d43897518c] Started GET "/store" for 88.172.57.6 at 2023-04-18 16:14:53 +0000
2023-04-18T16:14:53.128379+00:00 app[web.1]: I, [2023-04-18T16:14:53.128340 #2]  INFO -- : [06904ed8-3dd5-4d2d-83dc-96d43897518c] Processing by HomeController#index as HTML
2023-04-18T16:14:53.215790+00:00 app[web.1]: I, [2023-04-18T16:14:53.215705 #2]  INFO -- : [06904ed8-3dd5-4d2d-83dc-96d43897518c]   Rendered home/index.html.erb within layouts/storefront (Duration: 27.3ms | Allocations: 4134)
2023-04-18T16:14:53.218438+00:00 app[web.1]: I, [2023-04-18T16:14:53.218369 #2]  INFO -- : [06904ed8-3dd5-4d2d-83dc-96d43897518c]   Rendered layout layouts/storefront.html.erb (Duration: 30.0ms | Allocations: 5205)
2023-04-18T16:14:53.218657+00:00 app[web.1]: I, [2023-04-18T16:14:53.218630 #2]  INFO -- : [06904ed8-3dd5-4d2d-83dc-96d43897518c] Completed 200 OK in 90ms (Views: 16.4ms | ActiveRecord: 29.3ms | Allocations: 10033)
2023-04-18T16:14:53.347079+00:00 app[web.1]: I, [2023-04-18T16:14:53.346995 #2]  INFO -- : [38854ffb-c0e2-4161-9ba7-ad5aa80c54ec] Started GET "/cart_link" for 88.172.57.6 at 2023-04-18 16:14:53 +0000
2023-04-18T16:14:53.348035+00:00 app[web.1]: I, [2023-04-18T16:14:53.347982 #2]  INFO -- : [38854ffb-c0e2-4161-9ba7-ad5aa80c54ec] Processing by StoreController#cart_link as */*
2023-04-18T16:14:53.366413+00:00 app[web.1]: I, [2023-04-18T16:14:53.366308 #2]  INFO -- : [38854ffb-c0e2-4161-9ba7-ad5aa80c54ec] Completed 200 OK in 18ms (Views: 10.9ms | ActiveRecord: 3.5ms | Allocations: 3295)
2023-04-18T16:14:53.366611+00:00 heroku[router]: at=info method=GET path="/cart_link" host=<http://damp-plateau-87939.herokuapp.com|damp-plateau-87939.herokuapp.com> request_id=38854ffb-c0e2-4161-9ba7-ad5aa80c54ec fwd="88.172.57.6" dyno=web.1 connect=1ms service=22ms status=200 bytes=1296 protocol=https
2023-04-18T16:14:53.656022+00:00 heroku[router]: at=info method=GET path="/assets/application-37f365cbecf1fa2810a8303f4b6571676fa1f9c56c248528bc14ddb857531b95.js" host=<http://damp-plateau-87939.herokuapp.com|damp-plateau-87939.herokuapp.com> request_id=eb69345f-5900-4fd0-9653-d1b3aafe76db fwd="88.172.57.6" dyno=web.1 connect=0ms service=2ms status=200 bytes=323 protocol=https
2023-04-18T16:14:53.660969+00:00 heroku[router]: at=info method=GET path="/assets/turbo.min-f309baafa3ae5ad6ccee3e7362118b87678d792db8e8ab466c4fa284dd3a4700.js" host=<http://damp-plateau-87939.herokuapp.com|damp-plateau-87939.herokuapp.com> request_id=db45f616-22a7-434f-8bde-ff93399c4948 fwd="88.172.57.6" dyno=web.1 connect=0ms service=3ms status=200 bytes=22749 protocol=https
2023-04-18T16:14:53.671174+00:00 heroku[router]: at=info method=GET path="/assets/stimulus-loading-1fc59770fb1654500044afd3f5f6d7d00800e5be36746d55b94a2963a7a228aa.js" host=<http://damp-plateau-87939.herokuapp.com|damp-plateau-87939.herokuapp.com> request_id=f2161e80-0672-4de6-b945-19899bdcd38c fwd="88.172.57.6" dyno=web.1 connect=0ms service=1ms status=200 bytes=1202 protocol=https
2023-04-18T16:14:53.663079+00:00 heroku[router]: at=info method=GET path="/assets/stimulus.min-d03cf1dff41d6c5698ec2c5d6a501615a7a33754dbeef8d1edd31c928d17c652.js" host=<http://damp-plateau-87939.herokuapp.com|damp-plateau-87939.herokuapp.com> request_id=118db296-c3e5-4575-ae4f-af6b750b0d19 fwd="88.172.57.6" dyno=web.1 connect=0ms service=1ms status=200 bytes=10664 protocol=https
k
did you mount it on
/store
?
j
yes
k
can I see your routes file, please?
there are paths like
/cart_link
in the logs that are not under
/store
j
Rails.application.routes.draw do get ‘contacts/new’ get ‘contacts/create’ mount SolidusPaypalCommercePlatform::Engine, at: ‘/solidus_paypal_commerce_platform’ # root to: ‘home#index’ root to: “pages#home” get “store”, to: “home#index” get “reparation”, to: “pages#reparation” get “broderies”, to: “pages#broderies” get “contact”, to: “pages#contact” get “histoire”, to: “pages#histoire” get “command”, to: “pages#command” get “cgv”, to: “pages#cgv” resources :contacts, only: [:new, :create] devise_for(:user, { class_name: ‘Spree::User’, singular: :spree_user, controllers: { sessions: ‘user_sessions’, registrations: ‘user_registrations’, passwords: ‘user_passwords’, confirmations: ‘user_confirmations’ }, skip: [:unlocks, :omniauth_callbacks], path_names: { sign_out: ‘logout’ } }) resources :users, only: [:edit, :update] devise_scope :spree_user do get ‘/login’, to: ‘user_sessions#new’, as: :login post ‘/login’, to: ‘user_sessions#create’, as: :create_new_session match ‘/logout’, to: ‘user_sessions#destroy’, as: :logout, via: Devise.sign_out_via get ‘/signup’, to: ‘user_registrations#new’, as: :signup post ‘/signup’, to: ‘user_registrations#create’, as: :registration get ‘/password/recover’, to: ‘user_passwords#new’, as: :recover_password post ‘/password/recover’, to: ‘user_passwords#create’, as: :reset_password get ‘/password/change’, to: ‘user_passwords#edit’, as: :edit_password put ‘/password/change’, to: ‘user_passwords#update’, as: :update_password get ‘/confirm’, to: ‘user_confirmations#show’, as: :confirmation if Spree:AuthConfig[confirmable] end resource :account, controller: ‘users’ resources :products, only: [:index, :show] resources :cart_line_items, only: :create get ‘/locale/set’, to: ‘locale#set’ post ‘/locale/set’, to: ‘locale#set’, as: :select_locale resource :checkout_session, only: :new resource :checkout_guest_session, only: :create # non-restful checkout stuff patch ‘/checkout/update/:state’, to: ‘checkouts#update’, as: :update_checkout get ‘/checkout/:state’, to: ‘checkouts#edit’, as: :checkout_state get ‘/checkout’, to: ‘checkouts#edit’, as: :checkout get ‘/orders/id/token/token’ => ‘orders#show’, as: :token_order resources :orders, only: :show do resources :coupon_codes, only: :create end resource :cart, only: [:edit, :update] do put ‘empty’ end # route globbing for pretty nested taxon and product paths get ‘/t/*id’, to: ‘taxons#show’, as: :nested_taxons get ‘/unauthorized’, to: ‘home#unauthorized’, as: :unauthorized get ‘/cart_link’, to: ‘store#cart_link’, as: :cart_link # This line mounts Solidus’s routes at the root of your application. # This means, any requests to URLs such as /products, will go to Spree::ProductsController. # If you would like to change where this engine is mounted, simply change the :at option to something different. # # We ask that you don’t use the :as option here, as Solidus relies on it being the default of “spree” mount Spree:Core:Engine, at: ‘/’ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Defines the root path route (“/”) # root “articles#index” end
might be the issue then but why it is not in development ?
k
I guess, instead of
Copy code
get "store", to: "home#index"
you should do
Copy code
mount Spree::Core::Engine, at: '/store'
Oh no wait, that’s not correct.
j
aha i was gonna do that
k
I don’t know what happens between dev and production, but can you just try removing
get "store", to: "home#index"
and see what happens?
keeping the root at home#index
j
ok i ll try if i do that in development i won’t be able to access the store
k
in which way?
j
No route matches [GET] “/store”
Because it is my route to get to the store
k
I mean accessing
/
instead of
/store
BTW, I think what you need is wrapping all the Solidus routes into a
Copy code
namespace :store do
  # your routes here
end
This will add the
/store
in front of all of them.
j
hm ok sorry my bad
k
have to go now, but let me know if it’s solved
j
Ok store is in the root /
But still no products...
k
Did you set the availability date of products?
j
Hi, sorry i ve been busy on other stuff since. I ve set the availability date and stock but doesn’t change anything 😕
c
Following because I am having this same issue! I can get to the admin panel, but when I use 'heroku open', I get the "We're sorry. Something went wrong..." Can access admin panel Can also access products page - but the "home page" (?) or landing page (https://clpdesigns2023.herokuapp.com/) throws the same issue.