Katherine Pacheco
Katherine Pacheco

Reputation: 369

NextJS image module not found

Im new to NextJS. Im very confused about images. I get the below error. I followed the documentation for the npm next-image but I still cant display the image

Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file)

const withImages = require('next-images')
module.exports = withImages({
  webpack(config, options) {
    return config
  }
})

Upvotes: 1

Views: 2794

Answers (2)

Katherine Pacheco
Katherine Pacheco

Reputation: 369

I had to make sure to create a file called next.config.js in the root project directory. and place this inside

const withImages = require('next-images')
module.exports = withImages();

Upvotes: 0

n1koloza
n1koloza

Reputation: 1185

check your next version in package.json, if it is more than 10, you don't need any third-party libraries

Upvotes: 1

Related Questions