Reputation: 369
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
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
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