Rails asset pipeline can't find one certain image - ruby-on-rails-3

I have a certain image called ui-icons_ffffff_256x240.png. In production it can be found, among other places, in public/assets/images/ui-icons_ffffff_256x240.png.
When I try to view this image in production, I get the following error:
ActionController::RoutingError (No route matches [GET] "/assets/images/ui-icons_ffffff_256x240.png"):
I find this extremely odd since the image most certainly is there:
$ find . -name ui-icons_ffffff_256x240.png
./vendor/assets/stylesheets/jquery-ui/images/ui-icons_ffffff_256x240.png
./public/assets/jquery-ui/images/ui-icons_ffffff_256x240.png
./public/assets/images/ui-icons_ffffff_256x240.png
All the other images in my app work fine and have been forever. I recently upgraded my version of jQuery UI, though, and this one particular image doesn't want to work. (I think it's the only jQuery UI image I'm actually using.)
I'm on Rails 3.2.1. What could be the issue?

Your js plugin requests the image with invalid asset url.
The asset image can be accessed by
/assets/ui-icons_ffffff_256x240.png
But the requested url is
/assets/images/ui-icons_ffffff_256x240.png
So in your javascript or stylesheet you need to correct asset url manually.

Related

Migration odoo, Style error Could not get content

I upgraded the database to Odoo 15 but I still got this error:
Style error
The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.
Could not get content for /web/static/src/scss/webclient.scss defined in bundle 'web.assets_backend'.
and the log of browser:
Could not get content for /web_gantt_native/static/src/js/gantt_item_sorted.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:27116:9
Could not get content for /web_gantt_native/static/src/js/gantt_item.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:27119:9
Could not get content for /knowsystem/static/src/js/knowsystem_action_manager.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28037:9
Could not get content for /knowsystem/static/src/js/knowsystem_readonly_formcontroller.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28040:9
Could not get content for /knowsystem/static/src/js/knowsystem_readonly_formview.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28043:9
Could not get content for /knowsystem/static/src/js/sidebar.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28046:9
Could not get content for /web_notify/static/src/js/web_client.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28980:9
Could not get content for /web_notify/static/src/js/widgets/notification.js defined in bundle 'web.assets_backend'. web.assets_backend.min.js:28983:9
I already looked for the files but didn't find them in the addons src files also removed the ir_attachemnts for all js !
Any one got this error before and found a solution ?
Cause of the issue
This issue happens when static files no longer exist in a newer version of an app. After the migration is performed the assets bundles still expect to find them.
Solution
You can just delete those asset objects from shell for example(and do the same with the rest):
env['ir.asset'].search([('path', '=', '/web_gantt_native/static/src/js/gantt_item_sorted.js')]).unlink()
env.cr.commit()
If the record does not exist on the database add the static file as explained in the alternative solution.
Alternative Solution
Temporarily create those files. For example in your case create an empty file /web_gantt_native/static/src/js/gantt_item_sorted.js and include(Odoo Assets documentation) it in web.assets_backend. Once that is done, the issue should be gone and the database should run normal.
The answer provided looks fine, I just want to add that you can using the developer mode use the "regenerate asset bundle" feature that will help you with those kinds of assets issues.

Polymer 2 site cant find resources in Safari

I built this site http://danielleandsteven.wedding/ and it loads fine in most browsers. In Safari, I get a lot of errors that it cant load resources and the my-app elem is empty.
A quick glance of the list of 404 resources- it looks like some of them are for nonexistent components and others are in /bower_components/ but its looking for them in the base directory.
I tried it on Edge 15 and I got
Object doesn't support property or method 'call'.
You could add the Babel Polyfills?
https://babeljs.io/docs/usage/polyfill/
it adds some basic function that babel code may depend on - and as you probably served transpiled ES5 code (with babel) to those browsers it might be your problem.

react-native-webp loads some wep images but not all

I am using this module react-native-webp to load webp images on ios. However, I am not seeing the images from s3 load. Using an image found from google search, works fine. There are absolutely no logs whatsoever to help debug the issue!
This is an example url that doesn't load: http://s3-ap-south-1.amazonaws.com/rupyacard/offers/pictures/000/000/007/1280/dinner.webp
And this here is one that's loading just fine! https://www.gstatic.com/webp/gallery/1.sm.webp
Can't find a reason for either to not work. I thought it might have to do with the image size but a smaller version doesn't help either. Here's a smaller variant: http://s3-ap-south-1.amazonaws.com/rupyacard/offers/pictures/000/000/007/320/dinner.webp
Please give path images to HTTPS or just do following settings in xcode and clean rebuild app
The main problem is Apple can't load HTTP images without settings.

Worklight 6 + Dojo missing files error

I have gone through this post to run an application in production, but facing an issue.
https://www.ibm.com/developerworks/community/blogs/dhuyvett/entry/the_dojo_library_in_worklight_studio_v6_0?maxresults=15&lang=en
I have created a Worklight 6 hybrid application, listed below is a series of tasks that I performed on it.
I built and deployed the project with the 'Provide Library Resources' checked and I get a list of missing files (a few stated below) in the dojo library requests console and the application works fine.
[[2013-11-14 11:02:48] Application 'SampleBankingApp' requested a
missing resource. Providing library resource:
/dojoLib/toolkit/dojo/dijit/form/DateTextBox.js
[2013-11-14 11:02:48] Application 'SampleBankingApp' requested a missing resource. Providing library resource:
/dojoLib/toolkit/dojo/dijit/form/FilteringSelect.js
[2013-11-14 11:02:48] Application 'SampleBankingApp' requested a missing resource. Providing library resource:
/dojoLib/toolkit/dojo/dijit/Calendar.js]
I copied the missing files into the www folder keeping the folder structure as required, then I built and deployed the app with the 'Provide Library Resources' checked and I still get the same list of missing files in the dojo library requests console and the application also works fine.
Now I built and deployed by unchecking 'Provide Library Resources', when I tried to use the app it doesn't work, and the chrome console (where i use the mobile browser simulator) gives a series of errors like Failed to load resource: the server responded with a status of 404 (Not Found).
Whatever missing files it states in the dojo library requests console is in place inside the www folder, don't know whats going wrong.
I am using Eclipse Juno + Worklight6 + Dojo, any help would really be appreciated.
I think you may be failing on copying the resources to the correct path in the "www" folder.
For example, if you are missing /dojoLib/toolkit/dojo/dijit/form/DateTextBox.js, then you should copy that file into your_project/www/dijit/form

What are possible causes for differing behaviors in jsFiddle and in local context

Upon invsetigating 'mu is too short's answer to this question, I noticed that I get different behaviour in jsFiddle than in my local context for the exact same script. Any clues as to why that is?
Note:
I am not getting any javascript errors in Firefox's error console in the local context.
UPDATE:
I tried grabbing the HTML from fiddle.jshell.net/ambiguous/ZEx6M/1/show/light to a local file and loading that local file in Chromium browser and I got the following errors in the javascript console:
GET file:///css/normalize.css undefined (undefined) /css/normalize.css
GET file:///css/result-light.css undefined (undefined) /css/result-light.css
Resource interpreted as Script but transferred with MIME type application/empty jquery.scrollTo-1.4.2.js:-1
Resource interpreted as Script but transferred with MIME type text/plain jquery.viewport.js:-1
I can get rid of these javascript errors by downloading the files and modifying the <script> tags, but it doesn't solve the problem. The page still scrolls down to the very bottom. Also these errors appear even in the working (jsFiddle) version.
I also tried the same process in Konqueror. Result: the script does absolutely nothing.
Don't use separate files for CSS and javascript. Just bring everything into HTML file (using inline javascript and inline CSS) and you should be OK.
Or, run a web server locally to serve the javascript file (with the correct MIME type) and use relative paths to CSS.