jacobmischka / gatsby-plugin-react-svg

Adds svg-react-loader to gatsby webpack config
https://www.npmjs.com/package/gatsby-plugin-react-svg
MIT License
70 stars 21 forks source link

Error building on Vercel #52

Closed urre closed 2 years ago

urre commented 2 years ago

This plugin works great to build locally, but can't get it building on Vercel

Getting:

Error: Invalid tag: data:image/svg+xml;base64,....

Using this config:

  plugins: [
    {
      resolve: "gatsby-plugin-react-svg",
      options: {
        rule: {
          include: /icons/,
          omitKeys: [],
        },
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `icons`,
        path: `${__dirname}/src/icons`,
      },
    },
  ],
jacobmischka commented 2 years ago

Guessing that the path isn't correct when building on vercel, try './src/icons instead of using __dirname maybe.

urre commented 2 years ago

I tried it, but getting the same invalid tag error when building...

urre commented 2 years ago

I got it working now. It was another thing that broke the build