0

This is repository with my Angular frontend (part of full frontent with error) https://github.com/Alex-1557/ErrorModuleParseFailed

When I try to compile this Angular frontend I receive

./src/app/css/img/mini-logo.png:1:0 - Error: 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)
** Angular Live Development Server is listening on localhost:4200, open your browser on  http://localhost:4200/ **
× Failed to compile

Can somebody understand how to fix this issue? I have a couple advice, for example to add webpack.config.js (and other advice) but none of them is working.

1 Answers1

0

The error is in file ./src/app/css/img/mini-logo.png (a PNG), maybe:

You are missing an appropriate loader that would match that png of yours. To fix this, set up either url-loader or file-loader so that it matches your png.

url-loader has a limit option you may find useful. It allows you to control whether or not it emits dataurls (inline) or paths (uses file-loader and emits files matching to paths).

Source, Credits Juho Vepsäläinen

  • Thank you, but unfortunately NO, I have installed both package (with option --legacy-peer-deps). All packages installed successfully, but compilation result the same - Error: Module parse failed: Unexpected character '�' (1:0). –  Dec 19 '22 at 19:39