using SVG as background-image in css file causes bundle failure #31589
Labels
status: needs more info
Needs triaging and reproducible examples or more information to be resolved
type: bug
An issue or pull request relating to a bug in Gatsby
type: upstream
Issues outside of Gatsby's control, caused by dependencies
Description
I've got a Gatsby 3.4.1** site with a global style.css (it's a port of an existing site). Some elements have a background-image that references a .svg file. All works fine in development mode, but on production build the following error occurs:
I saw this recent issue and though mine is a different message and cause I wonder if it is also due to an upstream issue from that same package. My issue occurs whether I use a url beginning with
~
or climb the tree with../../
. Yes, putting the image instatic
and using an absolute path works, but only because that stops it from bundling at all.For some reason this only occurs with .svg files. It works fine with .png or .jpg.
Steps to reproduce
styles.css (just for argument's sake)
main.scss
index.tsx
Then run
yarn build
Expected result
The site should build. The svg should be bundled.
Actual result
Build fails on
Building production JavaScript and CSS bundles
Environment
No flags in gatsby-config
** Note: after writing this, I upgraded gatsby core + all plugins to 3.6.0 just to see if it would resolve the issue, but it didn't. The same error occurs in the same place.
The text was updated successfully, but these errors were encountered: