When implemented as a JS module, the function is out-of-scope in the button element’s onclick attribute.
git clone --single-branch -b hugo-forum-topic-47765 https://github.com/jmooring/hugo-testing hugo-forum-topic-47765
cd hugo-forum-topic-47765
hugo server
Thanks a lot! I could not find anything in the documentation about that, did I miss something? If not, it would probably make sense to add a comment about this in js.Build | Hugo