HUGO

Build failure with 0.92

I upgraded to 0.92 (from a much older 0.74.3 release…) and getting this build error (which obviously was not happening with 0.74.3):

Error: Error building site: MINIFY: failed to transform "quickstart/web/js/jamba-quickstart-frontend.js" (application/javascript): too many nested expressions on line 1 and column 137156
    1: ...}(t,e))),Xe()}var o},Js.prototype.invoke_...

Is this something I am doing wrong or an issue with hugo?

Thanks

I just wanted to add that running this file through MINIFY is somewhat pointless and removing this phase obviously fixes the issue. But it is weird that something that used to work with MINIFY no longer does…

Unfortunate? Yes.
Weird? Not really.

We use tdewolff/minify for general purpose minification, and we have seen some regressions (and subsequent fixes) as that module matures.

For JS minification, look at the ESBuild options.

It is possible that the problem you are experiencing has already been resolved upstream. We currently use tdewolff/minify v2.9.22, but the latest release is v2.9.27. It would be helpful if you could post the JS that failed to minify.

If you are fine with me posting a 33Kb (compressed) file on this forum then I am totally fine with it. It is generated by Kotlin/Js so it is in a way quite “minified” but that doesn’t mean that running it through minify should fail (especially when it used to not fail). Let me know if that is ok.

Proceed, or use a gist, pastebin, etc.

I created a gist: Hugo 0.92 Minify failure · GitHub

Thanks for posting this. I have the data required for testing and/or logging another issue as needed. Feel free to delete your gist. Thanks again for your help.

I was able to reproduce the problem with the latest version of tdewolff/minify:

It has purportedly been fixed in v2.9.28.

Happy to know you were able to reproduce the problem. I will delete the gist.