Skip to content

Why does cssbundling "lose" its CSS intermittently? Why does it seem to hiccup? #84

Closed
@jasonfb

Description

@jasonfb

Can someone explain to me why this gem seems to "lose" its CSS intermittently? It happens to me whenever I make a change to my JS files.

Then, if I make any change (like a whitespace change) to my SCSS files, it comes back, but it "hiccups"-- must be loaded twice before it can be fixed.

this is developmentally very significant and I would love to know what I'm missing here-- as far as I can tell this seems like a huge productivity blocker.

The effect is still present even after I use rake assets:clobber css:clobber javascript:clobber

the clobber does not even do its job correctly at all when the assets are 'stale' (which bizarrely happens very often in dev), but still it seems like half the time it puts the CSS in broken state and the other half the time it randomly works. Then if I load twice it fixes the CSS.

perhaps I'm missing something obvious? It seems like this is just baked into the gem and there isn't much I can do except reload things several times every time I make a change.

would strongly recommend prioritizing some understanding or better docs about this because as of now, this is not a good development experience.

When borked, my site loads like this:

CSS not present

then I run rake assets:clobber css:clobber javascript:clobber

Then I reload and it is still broken
CSS not present

Then I go make a whitespace change in application.bootstrap.scss

Then I reload again and it is still broken:
(this is the hiccup)

CSS not present

Finally, without making any further changes, I reload the window 3rd time and it snaps back into place:
fixed assets

Why does it do this? What am I missing?

Expected result:
It works consistently and makes sense and does not stop developer workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions