Open unit-404 opened 5 months ago
Hallo @unit-404,
I can not reproduce your error message. Can you please create small complete repo (package.json, webpack config, etc) with your issue message.
Following example: index.pug
something
if block
block
else
#{""}
Generate the error message:
ERROR in ./src/index.pug <== Exact in this FILE is an issue
Module build failed (from ../../../src/index.js):
Error:·
[pug-loader] Pug compilation failed.
Error: /Users/xxx/webpack/pug-loader/test/cases/exception-evaluate-template2/src/index.pug:6:5
4| something
5| if block
> 6| block. <== Exact here is the problem
-----------^
7| else
8| #{\"\"}·
Anonymous blocks are not allowed unless they are part of a mixin.
at Object.compile (/Users/xxx/webpack/pug-loader/src/index.js:272:26)
at Object.call (/Users/xxx/webpack/pug-loader/src/index.js:297:11)·
webpack 5.90.1 compiled with 1 error in 176 ms"
Wait some week, I try to find time for make and give reproducable case.
I can't even figure out anything, which pug file has the error, where the error is, who caused it, or what caused it. I can't even physically find it or calculate it, because the specific source is almost never given. So I am misled and extremely confused. Because of this, I am forced to just frantically and in a panic to look for any possible source of this problem.
And it tends to arise because of this kind of design...
And it seems like the design may not have a visual effect at all.
And I have previously, in one form or another, had similar problems.
Main and general issue: (in some cases) misinformation and misrepresentation.
Resolved? And yet my mistake has been identified, it has to do with the wrong mixin name. But it still does not cancel the fact that you can easily get lost and confused about what happened.