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

Error on documentation in gatsby-config.js #49

Open
erdemgonul opened this issue Dec 15, 2021 · 0 comments
Open

Error on documentation in gatsby-config.js #49

erdemgonul opened this issue Dec 15, 2021 · 0 comments

Comments

@erdemgonul
Copy link

erdemgonul commented Dec 15, 2021

Hi,
I searched for a solution to this problem for hours but finally found it with my own efforts. While the usage pattern shown in the document in the config file is as below, giving the rule object and regex without using strings creates a problem.

1- remove rule and use include under options
2- put regex expressions between string tags

plugins: [
  {
    resolve: "gatsby-plugin-react-svg",
    options: {
      rule: {
        include: /assets/ // See below to configure properly
      }
    }
  }
];

should be

plugins: [
  {
    resolve: "gatsby-plugin-react-svg",
    options: {
        include: "/assets/"
    }
  }
];

Produced error on documentation way:

Failed to execute 'createElement' on 'Document': The tag name provided ('data:image/svg+xml;base64,PD94bWwgdmV ..... is not a valid name.

Thank you for that great plugin also! 🔥🔥

Edit: I can open a PR on that if you're ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant