-
Notifications
You must be signed in to change notification settings - Fork 64
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
404 retrieving javascript asset in dev mode #55
Comments
ok that needs fixed, in the interum any reason you are requiring knockout js seperately? probably best to have an application.js with //= require knockout.min.js
//Require your app js That by chance work at all? |
Looks like |
that is how i am doing it. However in dev mode, the knockout.min.js is included as a separate |
weird, i tested with chrome too, saw the same format |
yea surprisingly this one hasnt hit me yet... Thanks for opening the issue (Im on a Mac as well so kinda odd) |
Hmm I just attempted to test this. The mime type is determined by using the servletContext.getMimeType(). I just created a testmin.min.js and it was served properly using grails 2.2.1 |
I assume you are running tomcat in dev correct? Also what jdk version are you running |
I am running Jetty 7.6.0, jdk version 1.7.0_45 |
ah its Jetty then. fantastic. |
Pushed a release (1.3.0) which should resolve this issue. Asset File definitions can now be defined as multiple accepted content-types. |
Saw your comment on the commit, whoops! fixed in 1.3.1 wasnt meant to stay. |
👍 thanky |
sorry, i still have the same problem with knockout.min.js since the format is "application/x-javascript", the the what is the purpose of that if statement? (line 15) it seems like this code needs to happen before the if statement: def contentTypes = AssetHelper.assetMimeTypeForURI(request.forwardURI)
format = contentTypes ? contentTypes[0] : null |
sorry to keep bugging on this issue...i do have a workaround using "-" :) |
Hah, guess its gonna be one of those days :). its because grails likes to mask off known extensions. i.e. js Hate to ask a silly question, any chance there is a newer jetty version? |
the extension is correct ("js") prior to the if statement |
don't worry about fixing this right away :) if I get a chance I'll write up a unit test for it |
I finally reproduced it by using Jetty, its definitely a Jetty in dev mode issue. I have a few helpers that have been added to AsseHelper since the original writing of this controller, let me clean it up a bit and this may be a non issue now. |
Ok, removed the debug println, and built a test app using Jetty and all your versions, finally reproduced the issue and confirmed a fix. Tests are passing for version 1.3.2 |
looks good now thanks a bunch! 🍻 |
I'm getting a 404 when retrieving an asset like
/assets/knockout.min.js
.If I change its name to "knockout-min.js" then it works fine.
I tried debugging the request and I saw this issue:
I'm not sure why the format is "application/x-javascript". OS/browser: Safari 7.0/OS-X 10.9
Grails: 2.2.4
My config.groovy declares mime type js='application/javascript'
The text was updated successfully, but these errors were encountered: