expo + next-images does not work with next 13

Please provide the following:

  1. SDK Version:
  2. Platforms(Android/iOS/web/all): web
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

This guide for Expo + Next does not work when loading local images. Image loading on the web always results in:
Error: Image import “./background-image.png” is not a valid image file. The image may be corrupted or an unsupported format. It looks like an issue in next-images which appears to have been abandoned.

Here is simple repro:
justinmann/expo-image-demo (github.com)

I figured out most of this issue. withImage from next-image just does not work anymore. It uses deprecated file-loader logic. The first step is to remove this dependency completely. With nextjs 13 it is unnecessary because it already supports require for local files.

If you make this change, then you hit an issue with react-native image control not supporting the images loaded in nextjs 13. I did not debug this any further, I just switched to using SolitoImage which uses the default image element for web rendering and it works correctly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.