parcel
parcel copied to clipboard
Build Error For Specific SVGs: Invalid Character Entity
🐛 bug report
This build error occurs:
@parcel/optimizer-svgo: SvgoParserError: :2:25: Invalid character entity
1 | 2 | <svg xmlns:x="&nsextend;" xmlns:i="&ns_ai;" xmlns:graph="&nsgraphs;" xmlns="ht… 3 |
🤔 Expected Behavior
The SVG should be accepted as it is, since there is nothing wrong with it to my knowledge.
😯 Current Behavior
Parcel bundler seems not to be able to handle HTML entities within xml attribute values in SVGs.
💁 Possible Solution
🔦 Context
💻 Code Sample
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.9.3 |
Node | v18.17.0 |
Operating System | Windows 10 |
I added --no-optimize
to the build script and everything works fine.
During the build, Parcel shows a message
⠸ Optimizing index.html...
You are trying to configure cleanupIDs which is not part of preset-default.
Try to put it before or after, for example
plugins: [
{
name: 'preset-default',
},
'cleanupIDs'
]
There is something with the svgo npm package
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
I added
--no-optimize
to the build script and everything works fine. During the build, Parcel shows a message⠸ Optimizing index.html... You are trying to configure cleanupIDs which is not part of preset-default. Try to put it before or after, for example plugins: [ { name: 'preset-default', }, 'cleanupIDs' ]
There is something with the svgo npm package
Worked for me thanks