When running assets:precompile, React::Renderer.setup! is executed before all assets is precompiled. So if image_path is used in xxx.js.erb, i get
Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError
Would you please don't execute after_initialize block on assets:precomile ?