Sorbet and Tapioca causing constant resolution issues in Rails monolith - how to fix? (srb tc failing)

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Hi all, I’m trying to introduce sorbet and tapioca in our Rails monolith and having some issues with constant resolution.
More specifically, I get a pretty big require.rb generated by tapioca that includes many constants coming from our packs.

For this reason, srb tc is currently failing with a bunch of The super class … of … does not derive from Class <https://srb.help/5067> because those constants are added to the todo.rbi file as modules.

I could simply change those to class in the todo.rbi file, but that doesn’t look right :confused:, am I missing some step in order to make sorbet/tapioca load our packs correctly?

I even added the following to require.rb, but still no luck :cry:

require 'config/environment'
Rails.application.eager_load!

OK I think I figured it out, I noticed this was only affecting app/public file and I noticed I had an --ignore=public/ config in sorbet/config.
Changing that to --ignore=/public/ made the majority of the issues go away :smile:

FYI — The suggestion about ignoring that folder came from this article

Interesting, I think public is where a lot of folks put various assets and such. Let me know if you need any help with any other sorbet things! We use sorbet very heavily in our application (80+ percent of files are typed true or above).

@AlexEvanczuk That is an impressive stat :clap: !
We’ve just started but I really hope we’ll get there one day :smile:
I’ve joined the Sorbet Slack community, so I guess I’ll see you there :wink:!