Closed krainboltgreene closed 10 months ago
It is autoloaded by zeitwerk. The constant is defined here https://github.com/dry-rb/dry-schema/blob/8de4754d2506dbbca54dcff197e48976d7564420/lib/dry/schema/messages/abstract.rb
Zeitwerk doesn't autoload it for me. I'm getting this error too:
/usr/local/bundle/gems/dry-schema-1.13.3/lib/dry/schema/messages.rb:22:in `block in setup': uninitialized constant Dry::Schema::Messages::Abstract (NameError)
options = config.to_h.select { |k, _| Abstract.setting_names.include?(k) }
^^^^^^^^
from /usr/local/bundle/gems/dry-schema-1.13.3/lib/dry/schema/messages.rb:22:in `select'
from /usr/local/bundle/gems/dry-schema-1.13.3/lib/dry/schema/messages.rb:22:in `setup'
from /usr/local/bundle/gems/dry-schema-1.13.3/lib/dry/schema/rule_applier.rb:21:in `block in <class:RuleApplier>'
@contentfree do you have require 'dry/schema'
anywhere that runs before?
I do not.
On Thu, Nov 9, 2023 at 6:14 AM Nikita Shilnikov @.***> wrote:
@contentfree https://github.com/contentfree do you have require 'dry/schema' anywhere that runs before?
— Reply to this email directly, view it on GitHub https://github.com/dry-rb/dry-schema/issues/459#issuecomment-1803635226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACVTTBAETZRMTKPEINGKTYDS3JPAVCNFSM6AAAAAAXKFXWP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTGYZTKMRSGY . You are receiving this because you were mentioned.Message ID: @.***>
Then you'll need to add it somewhere and it should work.
I still get this after adding require 'dry/schema'
. To fix, I have to require 'dry/schema/messages/abstract'
explicitly.
That's odd. I suggest you update other dry-* dependencies as well, it may be the cause. If this doesn't help, check if your code doesn't contain specific require
's like require 'dry/schema/messages/abstract'
and has require 'dry/schema'
instead.
Describe the bug
Dry::Schema::Messages::Abstract
in my application doesn't exist and I don't see anywhere in the gem where it's required?My environment