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

next-images TypeError: unsupported file type: undefined #18

Closed
RazaShehryar opened this issue Nov 20, 2021 · 3 comments
Closed

next-images TypeError: unsupported file type: undefined #18

RazaShehryar opened this issue Nov 20, 2021 · 3 comments

Comments

@RazaShehryar
Copy link

Hi,

I have installed everything correctly but still, I am facing this issue.

next-images TypeError: unsupported file type: undefined

Here's my next.config.js

const { withExpo } = require('@expo/next-adapter')
const withPlugins = require('next-compose-plugins')
const withFonts = require('next-fonts')
const withImages = require('next-images')

const withBundleAnalyzer = require('@next/bundle-analyzer')({
  enabled: process.env.ANALYZE === 'true'
})
const withTM = require('next-transpile-modules')([
  'app',
  '@gorhom/bottom-sheet',
  'react-doorman',
  'react-native-doorman',
  '@gorhom/portal',
  'dripsy',
  '@dripsy/core'
])

const nextConfig = {}

module.exports = withPlugins(
  [
    withTM,
    withFonts,
    withImages,
    withBundleAnalyzer,
    [withExpo, { projectRoot: __dirname + '/../..' }]
  ],
  nextConfig
)

@nandorojo
Copy link
Collaborator

Hmm did you take a look at the with-navigation branch? Maybe remote your .next folder?

@RazaShehryar
Copy link
Author

Hmm did you take a look at the with-navigation branch? Maybe remote your .next folder?

I did. But it isn't an issue with the navigation. Even if I import a single screen without navigation, it throws the undefined error if I try to import a static image like this

<Image source={require('./assets/logo.png'} />

@RazaShehryar
Copy link
Author

RazaShehryar commented Nov 20, 2021

okay nevermind, I had to add this to my nextConfig

const nextConfig = {
images: {
disableStaticImages: 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

2 participants