Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gatsby SVGs #13724

Closed
ernestosotelo opened this issue Apr 29, 2019 · 5 comments
Closed

Gatsby SVGs #13724

ernestosotelo opened this issue Apr 29, 2019 · 5 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@ernestosotelo
Copy link

ernestosotelo commented Apr 29, 2019

Edit: This issue has been pointed out here: jhamlet/svg-react-loader#102 which seems to be affecting gatsby-plugin-react-svg.

@jonniebigodes jonniebigodes added the type: question or discussion Issue discussing or asking a question about Gatsby label Apr 29, 2019
@jonniebigodes
Copy link

@ernestosotelo if you don't mind follow this and share the link so that we can take a look at it and track down the actual problem and work on a solution for your issue?

@ernestosotelo
Copy link
Author

@jonniebigodes I think I'm going to close this issue and troubleshoot more. I inserted the SVG components inside the Header component initially, and now I inserted the components into the IndexPage component to do additional testing and it rendered in an awful way. It's much more complicated than I thought - or I am missing something regarding using SVG components in Gatsby...

@jonniebigodes
Copy link

@ernestosotelo it's entirely up to you, if you want, share a repository emulating the issue you're experiencing so that it can be looked at. Otherwise feel free to close it and come back afterwards and reopen it when you're willing.

@ernestosotelo ernestosotelo changed the title Gatsby-starter-default SVGs Gatsby SVGs Apr 29, 2019
@Strangehill
Copy link
Contributor

Strangehill commented Jul 22, 2020

I'm having this issue (as have many others before). The solution I can't get to work, as I gather from the svg-react-loader docs, and the gatsby-plugin-react-svg docs, is to use query parameter classIdPrefix in gatsby-config to namespace class names and id names. I tried this, as follows:

      resolve: "gatsby-plugin-react-svg",
      options: {
        rule: {
          include: /\.inline\.svg$/,
          options: {
            classIdPrefix: "[name]-[hash:8]__"
          }
        }
      }

but instead of resulting in turning class/id names such as .st4 into .logo-a91$s@Fq__st4 which is what I expected, the resulting name was .[name]-[hash:8]__st4
I hope to have a reproduction ready soon.

@Strangehill Strangehill reopened this Jul 22, 2020
@LekoArts
Copy link
Contributor

We're not maintaining this plugin here, please open an issue on their issue tracker. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

4 participants