0

This image details the error message I got when I tried to build my parcel optimized internet project files

Hi there everyone!

I'm trying to build my internet files into a format that is optimized for the internet, but when I tried to build it using npm run build, it gave me the above error message even though I have mainly jpegs and png files that were processed and built correctly on other project files.

May I know how to fix this and/or understand the error code so I can resolve future errors of this nature? Below is the package.json file details in case you need it to help resolve the error.

Thank you so muchenter image description here

  • That looks like a bug. Can you share a simplified reproduction? – mischnic Oct 31 '21 at 10:03
  • Hi, can you clarify what you mean by a simplified reproduction please? Thanks! – Maxieprodmoore Nov 03 '21 at 03:10
  • The best thing would be if you could create and share a github repo where you have a (simplified) version of your project that, when you run the `parcel build` command, will produce the error above. That will allow us to debug parcel and see what is causing this error, and (hopefully) fix it. – Andrew Stegmaier Nov 03 '21 at 14:41

1 Answers1

2

As mentioned in the comments, this looks like a bug in @parcel/image-optimizer, and if you could share a more specific repro, that would be helpful.

In the meantime, you could probably work around this by disabling image optimization - just create a .parcelrc file at the root of your project that looks like this:

{
  "extends": "@parcel/config-default",
  "optimizers": {
    "*.{jpg,jpeg,png}": []
  }
}
Andrew Stegmaier
  • 3,429
  • 2
  • 14
  • 26
  • I see. Thanks mate! So it's just add this parcelrc file as you've suggested, and that should resolve the issue? No need to import it or anything to get it to work? So sorry for the odd question, this is the first time I'm jumping down the parcel configuration hole... Thanks once again! – Maxieprodmoore Nov 03 '21 at 02:26
  • 1
    No worries. Yes - there's no need to import anything else. When you run `parcel build`, parcel will go looking for a file called `.parcelrc` - if it finds it, it will use the configuration there, and otherwise fall back to the default config - see: https://parceljs.org/features/plugins#.parcelrc – Andrew Stegmaier Nov 03 '21 at 14:38