parcel icon indicating copy to clipboard operation
parcel copied to clipboard

Build Error For Specific SVGs: Invalid Character Entity

Open simonferndriger opened this issue 1 year ago • 2 comments

🐛 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

simonferndriger avatar Aug 01 '23 06:08 simonferndriger

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

howbizarre avatar Aug 09 '23 12:08 howbizarre

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.

github-actions[bot] avatar Feb 06 '24 00:02 github-actions[bot]

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

dekaido avatar Mar 14 '24 20:03 dekaido