Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming a javascript file my.class.js throw's a 'Sprockets::ContentTypeMismatch' #3140

Closed
antoinegrant opened this issue Sep 27, 2011 · 3 comments

Comments

@antoinegrant
Copy link

So when I require this file 'jquery.class.js' in application.js like so:
//= require jquery.class

I get this error:
Sprockets::ContentTypeMismatch
my.class is 'application/octet-stream', not 'application/javascript'

But if I rename the file and add an 's' at the end, everything works.
//= require jquery.classs // That works.

@guilleiguaran
Copy link
Member

Please report this in Sprockets issues tracker

@josh
Copy link
Contributor

josh commented Sep 30, 2011

The name of the file should end in a valid format, .js.

@josh josh closed this as completed Sep 30, 2011
@tomfuertes
Copy link

Had this same bug. Ended up fixing it per @josh above. Ex text below:

$ ls | grep raty
jquery.raty.js
jquery.raty.conf.js
$ cat application.js | grep raty
//= require jquery.raty
//= require jquery.raty.conf.js

JIC it helps someone!

-Tom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants