Open mcmillion opened 10 years ago
What does your app's manifest look like?
//= require jquery
//= require_tree .
The file being loaded (in the error above) is not in your manifest file so it is probably being loaded somewhere else.
If I had to guess I'd say you have a script tag in your layouts or views that point to /assets/jquery-1.10.2.min.js
Nope. No references to the file anywhere else, and if I take //= require jquery
out of the manifest, it stops appearing altogether.
The file that's being picked up is the file at provider/assets/javascripts/jquery.min.js
(which is version 1.10.2), as I just added a comment to the file and it appeared in the output js file.
Additionally, if I rename the jquery.min.js
to jquery-1.10.2.min.js
, I get a 500. Changing the manifest's require to //= require jquery.min
or //= require jquery.min.js
displays the same behavior above.
Well, isn't this the jquery that comes bundled into the package itself?
RE: https://github.com/CodeSleeve/asset-pipeline/blob/master/README.md#introduction-to-directives
It seems like a genuine bug if it's throwing a routing error. I guess it doesn't like where the file is located or maybe permissions?
@tabennett the immediate workaround is to remove the //= require jquery
and replace with your own jquery files. Personally, I usually rely on a CDN for jQuery (http://jquery.com/download/#jquery-39-s-cdn-provided-by-maxcdn or http://cdnjs.com/libraries/jquery/) and just put it right into my layout file(s). Or you could checkout a copy of jQuery to /app/assets/javascripts/vendor/jquery do something like //= require_tree vendor
in your manifest.
@kdocki What's the deal with the built-in jquery anyway?
@evantishuk That's what I've done for the time being.
Granted I don't know the internals, but it seems like it's checking multiple places or multiple filenames, as it does actually find jQuery, but it errors out on the filename it can't find.
Have the same issue, since //require= jquery.min
includes the jquery.min.js
in provider/assets/javascripts
I just created the jquery-1.10.2.min.map
in that folder and left it empty, error solved for now.
I'm getting a 404 whenever jQuery is imported. jQuery is still successfully loaded, but the log gets polluted with a stack trace on each page load.
Any ideas? jQuery resides in
provider/assets/javascripts/jquery.min.js