cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

SVG icons breaking icon-sprite.svg

Open nowlena opened this issue 6 years ago • 20 comments

Expected behavior

When generating icon-sprite.svg via grunt svgstore the sprite should load properly.

Actual behavior

The svg.icons-svg-sprite src gets set to (Unknown) instead of the SVG sprite as intended.

The reason: icon-sprite.svg cannot be loaded due to Namespace prefix sketch for type on path is not defined

I was able to fix the issue by stripping down (ie. removing the "mask" and " sketch:type" attributes) the following SVGs:

  • instagram.svg
  • stumbleupon.svg

Steps to reproduce behavior

Nothing specific, when running the Theme this issue occurred both locally and when bundling then applying to a storefront.

nowlena avatar May 23 '18 01:05 nowlena

same issue

xpothemes avatar May 23 '18 04:05 xpothemes

@nowlena @xpothemes I'm having some trouble reproducing this. Could you give me a little more info on the theme version you're using and the exact steps you took when you saw the issue? Thanks!

karen-white avatar May 25 '18 19:05 karen-white

Note the source attr: svg-issue

Some additional information: Theme Version: 2.0.0 OS: WIndows 10 Pro Browsers: Chrome 66, Firefox 60, Edge 42

Steps taken to reproduce error:

  • clone theme from BC repo
  • npm install
  • grunt svgstore
  • stencil init
  • stencil start -n

nowlena avatar May 26 '18 14:05 nowlena

Thank you, @nowlena ! I'm seeing the issue now. I'll get a ticket in for this so we can address it.

karen-white avatar May 29 '18 23:05 karen-white

same issue

sungsation avatar Jun 05 '18 11:06 sungsation

same issue here too

lucisousa avatar Jun 05 '18 18:06 lucisousa

Still facing the same issue. Any solution?

techxlers avatar Jun 11 '18 20:06 techxlers

@techxlers the solution is in code review here https://github.com/bigcommerce/cornerstone/pull/1258. Hopefully it should be merged in a day or 2.

junedkazi avatar Jun 11 '18 20:06 junedkazi

@junedkazi Thanks. BTW I am able to solve the issue by removing following "mask", "sketch:type", "sketch:name", "xlink". Icons are working now :)

techxlers avatar Jun 11 '18 20:06 techxlers

Same issue here. Tried implementing fix in #1258 but no luck

PeteyRev avatar Jun 13 '18 16:06 PeteyRev

@PeteyRev Did you try my fix?

techxlers avatar Jun 13 '18 16:06 techxlers

@techxlers I did except for the "remove xlink" - Where are you removing that, on the icon files themselves, or when you are adding to html:

<svg>
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-chevron-left"></use>
</svg>

PeteyRev avatar Jun 13 '18 17:06 PeteyRev

@PeteyRev Go to assets/img/icon-sprite.svg file. Open that file in any editor and then find the words which I have mentioned in my previous comment and then simply delete those tags.

techxlers avatar Jun 13 '18 17:06 techxlers

@techxlers perfect, thanks! Had to delete the mask element from stumbleupon.svg and its working now

PeteyRev avatar Jun 13 '18 17:06 PeteyRev

For reference, my initial post here explains how to fix the issue:

I was able to fix the issue by stripping down (ie. removing the "mask" and " sketch:type" attributes) the following SVGs:

  • instagram.svg
  • stumbleupon.svg

nowlena avatar Jun 13 '18 17:06 nowlena

@nowlena thanks, I think I may have overlooked that initially. Not enough coffee today

PeteyRev avatar Jun 13 '18 18:06 PeteyRev

Is this still an issue on the latest cornerstone ?

junedkazi avatar Jun 18 '18 17:06 junedkazi

@junedkazi this was an issue for me on version 2.1, so I think so

PeteyRev avatar Jun 18 '18 17:06 PeteyRev

This is still an issue in 2.2

This still works on 2.2

I was able to fix the issue by stripping down (ie. removing the "mask" and " sketch:type" attributes) the following SVGs:

instagram.svg
stumbleupon.svg

aisflat439 avatar Jun 27 '18 16:06 aisflat439

I am having this same issue on the latest version - is there any update on this?

Bobspadger avatar Sep 01 '21 14:09 Bobspadger