-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent/unexpected naming (Webauthn
vs WebAuthn
)
#352
Comments
I believe this is caused by the filename in your app as you mentioned. Zeitwerk is used to (re)load your Rails app code, not gems. From https://guides.rubyonrails.org/v7.0/autoloading_and_reloading_constants.html:
|
Yeah, I also believe it had to do with my app's Even if I still feel that following a more standard naming convention (i.e. |
There are certain setups that will try to do loading for us (e.g. Rails, or more specifically, Zeitwerk) which infer that if we have a
webauthn.rb
file, it will define aWebauthn
module (notWebAuthn
, as it currently does).I noted that a Sidekiq worker from my Rails app was raising a
NameError (uninitialized constant Webauthn)
.I could fix this by appendingrequire: false
to my Gemfile entry for this gem and manually callingrequire 'webauthn'
in the places where it was needed (e.g. initializer, controllers).Note: In my app I also have controllers such as
Webauthn::CredentialsController
inapp/controllers/webauthn/credentials_controller.rb
, and this could have been the cause of my particular error. Nevertheless, I think we could all benefit from sticking to a consistent naming from this gem.The text was updated successfully, but these errors were encountered: