IPX image load not working

For our website iamsterdam.com (team: iamsterdam) we use NextJS which uses IPX on Netlify (automatically) to resize and cache images. For the most part this works, but for some images we get the error: IPX Error: TypeError: unsupported file type: undefined (file: undefined). This only happens with these images on netlify, locally it works just fine, but then it’s using nextjs’s image resize and cache (/_next/image?url=...).

Example for image with this error: https://www.iamsterdam.com/_ipx/w_3840,q_75/https%3A%2F%2Fapp.thefeedfactory.nl%2Fapi%2Fassets%2F63d7ade92b50291e1f8f2158%2Fpitch-deck-training.jpg?url=https%3A%2F%2Fapp.thefeedfactory.nl%2Fapi%2Fassets%2F63d7ade92b50291e1f8f2158%2Fpitch-deck-training.jpg&w=3840&q=75
The original image seems to be fine: https://app.thefeedfactory.nl/api/assets/63d7ade92b50291e1f8f2158/pitch-deck-training.jpg

What does this error mean and how would I resolve it?

Hi @floris10hove What version of next are you using?

Hi, we’re using 12.1.6 right now.

Hi the error means you the file type is undetermined.

Is the file type supported by IPX? I would also make sure you check the URL format. It will also be helpful to review the IPX documentations.

Thanks for you reply. The image is a JPEG image so it is supported. When looking at response information for the image it also says content-type: image/jpeg. URL format seems to be fine too, since the URL works when I url-decode it.

Hey @floris10hove,

The devs were able to reproduce it in the following way:

  1. They took an avif image.
  2. Renamed the image so the extension was now .jpg.
  3. Used that as the source image.

Could you confirm if you were doing something like this?

If not, there’s still no explanation on what would be causing the error as it’s happening for that specific image and none other.

Hi @hrishikesh,

Wow, nice catch. That could be a problem indeed. I will pass this on and see if it works when they actually convert the image to JPEG.

Thank you!