Skip to content

Propshaft detection is load order dependant #151

@xymbol

Description

@xymbol

The Propshaft integration works without configuration but depends on the entries' Gemfile order. The detection works when the inline_svg is listed after propshaft.

The issue is caused by inline_svg determining which adapter to use in an after_initialize block and caching its value too early in the boot process when Propshaft is not ready. I found the call here:

config.asset_finder = app.instance_variable_get(:@assets)

Propshaft also uses an after_initialize block to finalize its configuration, and Rails keeps track of railties in their load order. That's why swapping the gems is a workaround.

A proper fix would be to evaluate asset_finder when called and once the assets are ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions