Title: Javascript Error Inline SVG
Last modified: April 19, 2021

---

# Javascript Error Inline SVG

 *  Resolved [vixperth](https://wordpress.org/support/users/vixperth/)
 * (@vixperth)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/javascript-error-inline-svg/)
 * Recently this plugin has started throwing some javascript errors in the console
   when trying to use the inline svgs. I am getting the error message “Uncaught 
   TypeError: Cannot read property ‘endsWith’ of undefined at Object.<anonymous>(
   svgs-inline.js?ver=1.0.0:63)”
 * This relates to this call `if (!imgURL.endsWith(‘svg’)) {
    return; }`
 * It would appear that the $target variable set above this section is not getting
   the correct data and none of the img variables wind up being defined.
 * Changing the target to simply ‘img.style-svg’ clears the error, but that removes
   the option to select your own class etc.

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

 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/javascript-error-inline-svg/#post-14577062)
 * Hi there,
 * Firstly, sorry for the insanely late reply! I’ve been slow lately, but I didn’t
   even get a notification about your post.
 * Thanks for pointing this out. This should be addressed in the next update.
 *  Plugin Author [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * (@benbodhi)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-inline-svg/#post-14708895)
 * Hi there,
    Are you still having issues with this? I can’t see any problems after
   having a dig… so I dare say this was a conflict of another plugin or theme.
 * I’ll mark as resolved, but please do just let me know if you still face issues,
   I’m more than happy to help out.

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

The topic ‘Javascript Error Inline SVG’ is closed to new replies.

 * ![](https://ps.w.org/svg-support/assets/icon.svg?rev=3554681)
 * [SVG Support](https://wordpress.org/plugins/svg-support/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/svg-support/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/svg-support/)
 * [Active Topics](https://wordpress.org/support/plugin/svg-support/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/svg-support/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/svg-support/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Benbodhi](https://wordpress.org/support/users/benbodhi/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/javascript-error-inline-svg/#post-14708895)
 * Status: resolved