Skip to content

Fix installed app crashing at startup: package zip.js - #6

Merged
Francy2009 merged 2 commits into
mainfrom
claude/latex-distribution-download-error-cmhhbo
Aug 10, 2026
Merged

Fix installed app crashing at startup: package zip.js#6
Francy2009 merged 2 commits into
mainfrom
claude/latex-distribution-download-error-cmhhbo

Conversation

@Francy2009

Copy link
Copy Markdown
Owner

Problema

Gli installer 1.3.0 morivano all'avvio:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'…\resources\app.asar\zip.js' imported from …\app.asar\main.js

Il campo files di electron-builder è una allowlist e elencava i moduli uno per uno (main.js, preload.cjs, latex.js). zip.js, aggiunto in 1.3.0 per il download in ZIP e importato da main.js, non era nella lista: restava fuori dal pacchetto. Dai sorgenti l'app funzionava, quindi nulla se n'era accorto.

Modifiche

  • files usa ora *.js, così un nuovo modulo top-level è incluso da sé invece di dipendere dal ricordarsi di questo file.
  • Nuovo desktop/verifica-pacchetto.mjs: parte da main.js e preload.cjs, segue gli import locali a cascata e fallisce se uno manca dall'app.asar costruito. Usa @electron/asar, già presente con electron-builder.
  • Eseguito sia dalla CI sia dal workflow di release, prima di pubblicare gli installer.
  • Versione a 1.3.1 + changelog.

Lo smoke test esistente lancia l'app dalla cartella dei sorgenti, dove ogni modulo c'è per costruzione: non poteva vedere la differenza fra sorgenti e pacchetto, ed è esattamente così che un installer rotto è finito pubblicato.

Verifica

Build reale in locale (electron-builder --linux --dir):

  • app.asar ora contiene zip.js accanto a main.js, latex.js, preload.cjs, vendor/
  • il binario pacchettizzato resta in esecuzione sotto xvfb senza ERR_MODULE_NOT_FOUND (prima terminava subito)
  • il controllo trova i 5 moduli del processo principale e esce 0
  • ripetuto su un app.asar da cui ho rimosso zip.js: esce 1 con moduli assenti da app.asar: zip.js — la guardia intercetta davvero il bug che ha causato questo problema
  • YAML dei due workflow validato

Generated by Claude Code

claude added 2 commits August 10, 2026 06:39
The 1.3.0 installers died on launch with
ERR_MODULE_NOT_FOUND for 'app.asar/zip.js'. electron-builder's
"files" field is an allowlist that named main.js, preload.cjs and
latex.js one by one, so zip.js -- added in 1.3.0 and imported by
main.js -- was never packaged. Running from source worked, which is
why nothing caught it.

The list now uses "*.js", so a new top-level module is included on
its own rather than depending on someone remembering this file.

Also adds verifica-pacchetto.mjs, run by CI and by the release
workflow: it walks the main-process imports from main.js and
preload.cjs and fails if any of them is missing from the built
app.asar. The existing smoke test launches the app from the source
directory, where every module is present by construction, so it
could not see the gap between sources and package -- which is
exactly how a broken installer got published.
The site still described a workflow that no longer exists. It told
visitors to upload .tex files so "the backend compiles" and returns
the results -- but the compiler was removed from the web in 1.2.0 and
now lives only in the desktop app. The footer likewise credited an
"Express backend" that today just serves these static pages.

Content, rewritten around the app that actually ships:
- what the three screens do, including the new one-ZIP-per-format
  download and the sandboxed HTML preview
- how the LaTeX engine is found or installed: TinyTeX into the user's
  own folder with no admin rights, then 31 base packages and 19
  TeX Live collections, and what is deliberately left out
- the Pacchetti page mapped to the tlmgr commands behind it
- every quizstruct command with its real signature, checked against
  the .sty, and what each one becomes in the PDF versus the HTML
- when network access is needed, and that sources never leave the
  machine

Design: system fonts only (no remote requests), serif headings, one
green accent, and a dark palette via prefers-color-scheme. Dropped the
emoji step icons, the 01-06 section counters, the decorative glow and
the scroll-triggered fade-ins. The hero now shows one source fragment
beside its two renderings, so the page demonstrates the product rather
than asserting it. Tables replace card grids where the content is
genuinely tabular.

Verified in Chromium: no horizontal overflow at 12 widths from 320px
to 1600px, light and dark, no console errors, one h1 with no skipped
heading levels, working tabs and mobile menu.
@Francy2009
Francy2009 merged commit da4e764 into main Aug 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants