Closed markgaze closed 3 years ago
Just trying to get to the bottom of this and setting svg4everybody
to false
stops this error from showing ~but doesn't generate the SVG~, thought I'd log my updates ๐
EDIT: The SVG does in fact, get generated
~Hmm... I've just reworked my webpack config and now this error has gone away... I did uninstall another plugin so that might have been affecting things but still a bit confused about why changing svg4everybody
to false
fixed it earlier.~
~Feel free to close this unless you can recreate it, apologies for wasting your time!~
EDIT: Me again... Turns out it wasn't fixed and was just cached so I'm back to getting this issue in CI ๐
Haha, no problem, I'm able to reproduce it using the following configuration. Let's see if we can also find a solution now ๐ต๐ผโโ๏ธ.
new SVGSpritemapPlugin('src/**/*.svg', {
output: {
svg4everybody: true
}
})
I think I've found the issue, would you mind sharing your entire Webpack configuration to ensure I didn't miss anything? I'm especially interested in your entry
(if you've defined it at all).
I think I've found the issue, would you mind sharing your entire Webpack configuration to ensure I didn't miss anything? I'm especially interested in your
entry
(if you've defined it at all).
Awesome, thank you! It's a private project unfortunately but I'll anonymise it and stick it in this issue ASAP ๐
The entry
currently only has a bunch of .ts
files and a couple of .scss
files though.
It's mainly about the structure of the entry
value, there's handling for strings, arrays, and objects with different structures and I think you're using a specific type that's not correctly supported currently but I need to know what it looks like to test it ๐
It's mainly about the structure of the
entry
value, there's handling for strings, arrays, and objects with different structures and I think you're using a specific type that's not correctly supported currently but I need to know what it looks like to test it ๐
It's an object that looks like this (I've changed the names of stuff but it's the same format so hopefully that works for you!):
entry: {
componentA: './src/ts/componentA.ts',
app: './site/static/js/app.js',
'component-b': './src/ts/subdirectory/component-b.ts',
'component-c': './src/ts/component-c.ts',
componentD: './src/ts/componentD.ts',
'component-e': './src/ts/component-e.ts',
'component-f': './src/ts/component-f.ts',
componentG: './src/ts/componentG.ts',
'component-h': './src/ts/component-h.ts',
'component-i': './src/ts/component-i.ts',
'component-j': './src/ts/component-j.ts',
'component-k': './src/ts/component-k.ts',
'component-l': './src/ts/component-l.ts',
'component-m': './src/ts/component-m.ts',
'component-n': './src/ts/component-n.ts',
componentO: './src/ts/componentO.ts',
componentP: './src/ts/componentP.ts',
componentQ: './src/ts/componentQ.ts',
componentR: './src/ts/componentR.ts',
'component-s': './src/ts/component-s.ts',
'doc-site': './src/doc-site/scss/doc-site.scss',
'site-style': './src/scss/site-style.scss'
},
Awesome, that's indeed a format that appears to be broken. Fix coming right up :v:
Awesome, that's indeed a format that appears to be broken. Fix coming right up โ๏ธ
Legend! Thanks ๐
This should be fixed in 3.6.1
which is now available under the next
dist-tag on NPM.
$ npm install svg-spritemap-webpack-plugin@next
Please test this release out using both Webpack 4 and 5 if possible and report any problems.
Fantastic, thank you! Will give it a go and let you know ๐
Tested with Webpack 4 and 5 and I can confirm that it works with both ๐
Thanks for all your help with this, you're a lifesaver! โค๏ธ
Well, thanks for your help! It prevents a lot of stress and hassle if people test out a release before stamping the stable/latest label on it. โ๐ผ
The
#webpack5
version fixed my issues but since switching to v3.6.0, I get this:Config
Here's the section of the
plugins
array related to this package:I've tried to change a few things to see if there was anything else causing it (as I've bumped a few other dependencies at the same time) but it seems like the update to v3.6.0 is the cause. Let me know if I can help you out with debugging this and I'll see what I can do.