How to identify source of minification error?

I recently updated Hugo and started getting errors that I believe are related to minification. The following error disappears when the minification flag is omitted:

> hugo --verbose --templateMetrics --templateMetricsHints --minify
Start building sites … 
hugo v0.88.1+extended darwin/arm64 BuildDate=unknown

[info and metrics output omitted]

Error: Error building site: failed to render pages: expected Identifier instead of ( in function declaration on line 465 and column 30
    1: function();
               ^
Total in 9786 ms

Is there a way to get information about what template file was being processed at the time the error was generated? What post?

There is a new CLI parameter --panicOnWarning in 0.92.0, that IMHO should help here. And… I don’t think it’s a minify issue, more like a JS building issue. Try adding a function name, even if the name is not used. Maybe trying out eslint on your scripts might bring some light into why a nameless function at that point is irritating someone.

@davidsneighbour thank you for the reply!

I can confirm that 0.92 with the --panicOnWarning switch did cause the Hugo build to stop earlier:

WARN 2022/01/17 06:20:38 The "tweet" shortcode will soon require two named parameters: user and id. See "[file path omitted]"

But it still doesn’t identify which file caused this error that only appears when the --minify switch is on:

Error: Error building site: failed to render pages: expected Identifier instead of ( in function declaration on line 465 and column 30
    1: function();
               ^

I appreciate the other suggestions as well, but I’m really curious how to get information about what file caused the fatal error in Hugo. Is there any way to get that?

Can you share your project repository? Privately if you would prefer. There were some minify regressions that have been recently fixed, but not released. I’d like to determine if this is a new regression or something already resolved.

And yes, I know this doesn’t answer your question, “Is there a way to get information…”