Skip to content

New files get ignored #107

Closed
alanhogan opened this Issue Jun 5, 2012 · 8 comments

7 participants

@alanhogan

Scenario:

  • Rails 3.2 project.

  • My stylesheet includes this line:

    @import "core/pages/*"
    
  • Adding a new file core/pages/x.sass has no effect.

  • Adding this line to my stylesheet causes x to be noticed:

    @import "core/pages/x"
    
  • x will continue to be paid attention to after this, even if the line in the previous step is removed.

Neither rake tmp:clear nor rake assets:clean seem to have no effect on the above.

Neither does modifying the main stylesheet in a trivial way (like adding whitespace or touch-ing).

Is there any way I can tell sass-rails, doing its asset-pipeline magic, to force update?

See also: Compass/compass#818 and Compass/compass-rails#46

@alanhogan

Is this a sprockets bug? Filed: sstephenson/sprockets#336

@alanhogan alanhogan referenced this issue in sstephenson/sprockets Aug 14, 2012
Closed

New files get ignored #336

@swrobel
swrobel commented Apr 9, 2013

Still seeing this on sass-rails 3.2.6 with sprockets 2.2.2.backport1

Anyone have a workaround?

@swrobel
swrobel commented May 13, 2013

anyone? bueller?

@alexcp
alexcp commented Jun 5, 2013

I'm having the same issue.

@chriseppstein

This is because the importer doesn't implement the mtime method. It needs to check if the uri is a glob and if it is, it should return the mtime of the most recent file changed otherwise it should delegate to the superclass.

Here's how I do this in the sass-globbing plugin: https://github.com/chriseppstein/sass-globbing/blob/master/lib/sass/globbing/importer.rb#L64-L76

anyone care to make a patch?

@bolandrm

I'm still seeing this behavior. If I get a chance I'll look into doing a pull request, but for now here's a workaround for anyone else that needs a quick fix. (never mind, didn't work).

@jeroenj
jeroenj commented Jan 9, 2014

The workaround I'm using when adding new files is changing the file that has the import. Adding a newline is enough to let it compile again. Simply touching it does not work, you really have to change it.

@travisp
travisp commented Feb 25, 2014

Just ran into this bug in Rails 4 and #184 seems to fix it. Is there any reason we can't merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.