Title: Minify JavaScript removes an image
Last modified: September 17, 2020

---

# Minify JavaScript removes an image

 *  Resolved [antonggg](https://wordpress.org/support/users/antonggg/)
 * (@antonggg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/)
 * Hi,
    Installing the plugin seems to have improved our load times quite a bit,
   I guess mostly due to caching. I wanted to give Minify a try, but one image on
   our front page disappears when I activate Minify JavaScript, possibly also some
   more images, but that’s what I could see imediately. It works for html and CSS.
 * I tried to further narrow it down by using the options “Enable minification of
   JavaScript files” and “Enable merging of JavaScript files”, but both create this
   problem. While having a technical background, I am not a web developer, so I 
   am not too much familiar with those settings.
 * Any idea what causes this, should I exclude a certain file or similar?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fminify-javascript-removes-an-image%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419645)
 * Hi there,
 * Could you share a screenshot of the issue VS no issue, then enable minification
   of JS and enable “Contain each included file in its own block” (just until I 
   can see the issue)?
 * Marc.
 *  Thread Starter [antonggg](https://wordpress.org/support/users/antonggg/)
 * (@antonggg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419707)
 * Hi Marc,
 * Thanks for your fast reply. Here is the screenshot: [https://drive.google.com/file/d/1vS_xFpwkcqG0jMcb0UnjKYHpkXl-y3Tq/view?usp=sharing](https://drive.google.com/file/d/1vS_xFpwkcqG0jMcb0UnjKYHpkXl-y3Tq/view?usp=sharing),
   and I enabled Minify for JavaScript as instructed.
 *  Thread Starter [antonggg](https://wordpress.org/support/users/antonggg/)
 * (@antonggg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419742)
 * Strangely, this is only an issue on the English version, not the French site.
   I found some other images with the same problem, all in English only:
 * – An image on [https://canamasq.com/about-us/](https://canamasq.com/about-us/)(
   present in French)
    – multiple images on the product pages [https://canamasq.com/shop/canamasq-reusable-facemask](https://canamasq.com/shop/canamasq-reusable-facemask)
   and [https://canamasq.com/shop/childsize-canamasq-reusable-facemask](https://canamasq.com/shop/childsize-canamasq-reusable-facemask)(
   as well present in French).
 * The English is the original site, French is translated with WPML.
    -  This reply was modified 5 years, 9 months ago by [antonggg](https://wordpress.org/support/users/antonggg/).
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419802)
 * All the pages you linked work fine for me, both in English and French.
 * What I noticed is that Lazy-loading is enabled on the images, so it could be 
   related to that feature.
 * On a page where the image doesn’t appear, could you open your browser’s console
   and check for errors? There current are several errors, but they are related 
   to a video player which seems to be blocked. So we’re looking for something else.
 * Edit: Are you logged in when seeing the issue?
    -  This reply was modified 5 years, 9 months ago by [Marc Lacroix](https://wordpress.org/support/users/marcusig/).
 *  Thread Starter [antonggg](https://wordpress.org/support/users/antonggg/)
 * (@antonggg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419871)
 * Hi Marc,
 * Just check: Yes, these images disappear only when logged in with Firefox, when
   using a different browser or a private window in Firefox to be logged out it 
   works fine.
 * Additionally, disabling lazyload (through Jetpack) makes them also visible everywhere.
   Since seeing the site correctly also when logged in would be important: Any fix?
   Or generally, would enabling minify or lazyload of images give me more performance,
   if I can select only one? This isn’t a crazy complex page…
 * I find the following errors (here on About, but the same as well on the other
   pages):
    `"Uncaught SyntaxError: missing } after property listwpo-minify-footer-
   873ccc63.min.js:108:156note: { opened at line 108, column 129"`
 * Thanks!
    -  This reply was modified 5 years, 9 months ago by [antonggg](https://wordpress.org/support/users/antonggg/).
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419929)
 * > Any fix? Or generally, would enabling minify or lazyload of images give me 
   > more performance, if I can select only one? This isn’t a crazy complex page…
 * You should be able to use both, we just have to narrow it down to the file that
   causes the issue.
 * The error you shared would be the one, but the file contains a too much informations
   for me to be sure.
 * So could you disable “Enable merging of JavaScript files” for now, and check 
   for a similar error?
 *  Thread Starter [antonggg](https://wordpress.org/support/users/antonggg/)
 * (@antonggg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419950)
 * With this option disabled, the image gets displayed.
    Error messages:
 *     ```
       Uncaught SyntaxError: missing } after property list
       wpo-minify-footer-googlesitekit-modules-adsense.min.js:8:156note: { opened at line 8, column 129
       wpo-minify-footer-googlesitekit-modules-adsense.min.js:8:129
       Uncaught SyntaxError: missing } after property list
       wpo-minify-footer-googlesitekit-modules-analytics.min.js:10:32604note: { opened at line 10, column 32577
       wpo-minify-footer-googlesitekit-modules-analytics.min.js:10:32577
       Uncaught SyntaxError: unexpected token: identifier
       wpo-minify-footer-googlesitekit-modules-tagmanager.min.js:2:52895
       ```
   
    -  This reply was modified 5 years, 9 months ago by [antonggg](https://wordpress.org/support/users/antonggg/).
 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13419998)
 * Ok. You can try to `add google-site-kit/dist/` to the setting “Exclude JavaScript
   from processing”, and try to re-enable merging of files.
 *  Thread Starter [antonggg](https://wordpress.org/support/users/antonggg/)
 * (@antonggg)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13420155)
 * Thanks, that worked!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Minify JavaScript removes an image’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [antonggg](https://wordpress.org/support/users/antonggg/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/minify-javascript-removes-an-image/#post-13420155)
 * Status: resolved