Skip to content


Subversion checkout URL

You can clone with
Download ZIP


3.2.4+ assets:precompile regression #6737

rwz opened this Issue · 12 comments

9 participants


Starting from 3.2.4 Rails assets:precompile task just ignores files with names like 'index.(css|js)'.

Because of #3993 I had to manually add index files to config.assets.precompile array. Now it just skips such files. So, application that was working perfectly fine on 3.2.3 throws AssetNotPrecompiledError constantly.

Here is the showcase:

The public folder contains assets compiled on 3.2.3 and on current 3.2.6. The difference is that folder was completely ignored in 3.2.6.


Nice showcase @rwz, I've checked your app and I see that you use [ 'folder/index.js' ] but it had been workaround when rake task was skiping index files, but now you can just write [ 'folder.js' ] and it will be compiled. Another case when debug option is off and you are writing javascript_include_tag "folder", the script tag will be <script src="/assets/folder.js" type="text/javascript"></script> also as and precompiled. I think it's not regression /cc @drogus @guilleiguaran


This is something that was working before and not working now, so it is clearly a regression for me. Also, i'm explicitly adding index.js file which exists AND this code works in development but not in production. I think this is both misleading and inconsistent.

What i think should actually happen here is this:

  • if this file like folder/index.js explicitly added to assets.precompile array, it should be compiled as folder/index.js
  • if the file added is folder.js, it should first try folder.js, then folder/index.js and compile it as folder.js

@rwz I've got your point, I think it justified, I can take a look, but it would be nice to hear core team opinion.


Also breaks if you use *.js and *.css for the asset list. It loads everything but the index.(js|css).


I found the same as @edgard. I was using *.js for the asset precompile list, and found that some_folder/index.js was changed to some_folder.js once precompiled after upgrading from 3.2.3 to 3.2.6.

We weren't expecting this change, and it broke our production site. Only after scrambling to fix this issue and researching further did our team find this documentation detailing the special behavior of assets named index.js/css.


This is hitting us too. We were on 3.2.3 and do things like

javascript_include_tag 'runs/index'

and we have app/assets/javascripts/runs/ It is not a manifest file but contains actual logic. Unfortunately for us, it's getting compiled to runs.js instead of runs/index.js.

Any chance this will be fixed, or is it truly not a bug (because of the index.js manifest feature of Sprockets)?


I recently upgraded to 3.2.8 and encountered this issue. I was able to solve it by changing this in the production.rb config file:

config.assets.precompile += ['folder']


config.assets.precompile += ['folder.js']

and then using it in the specific views through:

javascript_include_tag 'folder'

where folder is the folder name containing the index.js file. Basically, adding the '.js' extension to the folder name in the precompile config did the trick. I don't why this behavior changed; the previous one made more sense to me.


Fixed @ 19987b6

@jeremy jeremy closed this

question: I noted that when I created an "application-all.css.scss" file in /assets/stylesheets, and my "application.css.scss" file was in /assets/stylesheets/all, the command in my config.assets.precompile -

config.assets.precompile += %w( application-all.css.scss application-print.css.scss application-ie.css.scss)

Was ignored. Rather, I needed to remove the ".scss" extension, even though the files end in ".scss". The following works:

config.assets.precompile += %w( application-all.css application-print.css application-ie.css)

This seems to refute the statement in the comments in 3.2.8

"# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)"

Since the .scss was not added.


@cvandermey scss is a preproccessor in that case. For assets pipeline this file's called application-all.css. It doesn't care if it's compiled out of SCSS or SASS or even LESS.

The same with javascript. If you name your file, you'll need to add my-file.js to the config.assets.precompile for assets pipeline to recognize it properly.


Questions are best asked on StackOverflow, not on Issues.

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.