Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot convert undefined or null to object #84

Open
jmorey28 opened this issue Feb 1, 2022 · 4 comments
Open

TypeError: Cannot convert undefined or null to object #84

jmorey28 opened this issue Feb 1, 2022 · 4 comments

Comments

@jmorey28
Copy link

jmorey28 commented Feb 1, 2022

I am using withImages as documented in the Expo documentation but am getting TypeError: Cannot convert undefined or null to object.

Here is the link to the documentation https://docs.expo.dev/guides/using-nextjs/#image-support

And here is the implementation:

const { withExpo } = require("@expo/next-adapter");
const withImages = require("next-images");

module.exports = withExpo(
  withImages({
    projectRoot: __dirname,
  })
);
@gregogalante
Copy link

I have the same problem!

@theartofnonso
Copy link

I am facing the same issue as well.

I have followed the instructions in the docs.

The problem is because withImages() is not being recognised as a function

@jmorey28 @gregogalante did you manage to fix it?

Cheers

@acrabb
Copy link

acrabb commented Sep 20, 2022

Same issue here 😭
"next-images": "^1.8.4",

@smnchoi
Copy link

smnchoi commented Nov 23, 2022

This config works for me. cheers.

// @generated: @expo/[email protected]
// Learn more: https://docs.expo.io/guides/using-nextjs/

const { withExpo } = require("@expo/next-adapter");
const withPlugins = require("next-compose-plugins");
const withTM = require("next-transpile-modules")(["react-native-web"]);
const withImages = require("next-images");

module.exports = withPlugins(
  [
    withTM,
    [withExpo, { projectRoot: __dirname }],
    [
      withImages,
      {
        projectRoot: __dirname,
        // fileExtensions: ["png"],
        // disableStaticImages: true,
        // esModule: true,
        images: {
          fileExtensions: ["png"],
          disableStaticImages: true,
          //   esModule: true,
        },
      },
    ],
  ],
  {}
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants