That bug should now be fixed in master.
Somehow a buggy early version of fix_opf_ids.py got commited to master when my fixed local copy at that time did NOT get committed. Then at some point I force pulled from master and lost that version of the file completely. Luckily I did find a copy on my laptop but either way that code path (duplicate generated ids) was most likely untested.
The results from running that command on supplied testcase ends up as follows:
Code:
<?xml version="1.0" encoding="utf-8"?>
<package version="3.0" unique-identifier="BookId" xml:lang="en" xmlns="http://www.idpf.org/2007/opf">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>Lorem Ipsum</dc:title>
<dc:language>en</dc:language>
<meta property="dcterms:modified">2025-04-15T14:06:23Z</meta>
<dc:identifier id="BookId">urn:uuid:546f8314-1dd0-457c-8289-1e2c0fcacb57</dc:identifier>
<meta name="Sigil version" content="2.4.2"/>
</metadata>
<manifest>
<item id="nav_xhtml" href="xhtml/nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
<item id="section1_xhtml" href="xhtml/section1.xhtml" media-type="application/xhtml+xml"/>
<item id="BasicLatin_js" href="mathjax/jax/output/SVG/fonts/TeX/Main/Regular/BasicLatin.js" media-type="text/javascript"/>
<item id="BasicLatin_js0001" href="mathjax/jax/output/SVG/fonts/TeX/Main/Italic/BasicLatin.js" media-type="text/javascript"/>
</manifest>
<spine>
<itemref idref="section1_xhtml"/>
<itemref idref="nav_xhtml"/>
</spine>
</package>
If you are on Linux or Windows, I would be happy to post that fixed python script for you to replace its namesake in your version of Sigil.
If you are on MacOS, the full Sigil app is signed and changing any of the code will change the signature potentially causing a problem.
In that case you will have to wait for the next release for the fix.
To workaround this issue, you can just rename the second javascript file temporarily to something unique (filename part not the path), run the tool and then change it back.
Sorry about that.
And thank you for your bug report and nice testcase!