S
S
Stas Khitrich2021-02-03 11:47:43
Less
Stas Khitrich, 2021-02-03 11:47:43

Why does webpack error: Unexpected character @ occur?

There is a project that is built on different computers, but on some it gives an error when processing the less file.
The error looks like: Module parse failed: Unexpected character '@'. The error pops up only in less, in scss there is no such thing. The error happens when you @ import another less file into this one.
Config:
}, {
test: /\.less$/i,
use: ['style-loader', 'css-loader', 'less-loader'],
exclude: [/mobile/]
},
I tried changing the node version to 10, 14, deleting the entire global node_modules, clearing caches, various less configs, the Ubuntu version matches those where the project is running, there is also the same problem on a Windows computer (also a single one). Hands down already, maybe someone has come across and will tell you what else you can try.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question