Dingus45191
Dingus45191

Reputation: 569

Next JS: Module parse failed: Unexpected character '�' (1:0)

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)

Error while importing image.

Does anyone know why this is happening?

I am using nextjs

Upvotes: 6

Views: 14248

Answers (2)

Eric. M
Eric. M

Reputation: 170

for people having the problem @Prabhu answer is correct but you can use it like this with out giving content. it worked for me with this error on .png image

Install: npm install next-images

in root dir => next.config.js


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

Upvotes: 1

Prabhu
Prabhu

Reputation: 768

In next.config.js import next-images

const withImages = require('next-images')

and in module.exports use it like

module.exports = withImages({ ...//your content here })

Upvotes: 0

Related Questions