Sidekiq web UI compiling error due to name space changed in kemal-session
Closed this issue · 1 comments
When I tried to compile the example provided in Sidekiq.cr, I encountered the following error:
src/web.cr:5: undefined constant Session
Session.config do |config|
^~~~~~~
Trace the shards.yml in Sidekiq.cr, I found cause.
Sidekiq.cr depended kemal-crsf 0.2.0 which depended on kemal-session master branch. However, one of the recent changes in kemal-session master branch was to change the name space for kemal session from "Session" to "Kemal::Session". That caused the above undefined constant error on "Session". I added a class alias before the Session.config section:
Session = Kemal::Session
and that walked around the issue for the time being. However, I think it would be better to fix this from the root.
Then, I checked kemal-crsf and found it had a new tag 0.3.0 created which specified kemal-session dependency to version 0.8.0 explicitly instead of the master branch. So, I guess in Sidekiq.cr, the kemal-crsf dependency should be upgraded to this tag. On the other hand, I also noticed kemal-csrf 0.3.0 upgraded its kemal to 0.20.0 while Sidekiq still used 0.19.0. This could be a potential conflict. You might want to upgrade Sidekiq to the most recent kemal version to 0.2.0.
I am still new to Crystal so my suggestions could be incorrect. just want to share my findings and hope this could help fix the issue quickly. Thank you very much for porting Sidekiq to Crystal which is a superb job scheduling product!
I ran into this issue as well