Skip to content

fix(embed, normalize): an output in a folder that does not exist is refused by name (#290) - #291

Merged
alekswebnet merged 2 commits into
mainfrom
fix/scorm-missing-folder
Nov 26, 2026
Merged

alekswebnet merged 2 commits into
mainfrom
fix/scorm-missing-folder

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #290.

An output named in a folder that does not exist is now refused by name, before any work.

  • h5p-embed --scorm (buildScorm): it ended in an uncaught ENOENT with a stack trace, after the whole zip had been planned. It now exits 1 with No such folder: <folder>. Create it, or name a zip in a folder that exists.
  • h5p-normalize -o (normalizeArchive): it exited with error: h5p.json: ENOENT …, blaming an entry. It now names the folder, before the source is opened.

h5p-author build and bundle already refused such an output, and h5p-embed <folder> and h5p-author read create their folder; those are unchanged.

Tested

  • packages/embed/tests/scorm.test.ts: 38 of 38, with the new case (refused as an EmbedError, and the folder is not created).
  • packages/normalize/tests/normalize.test.ts: 12 of 12, with the new case.
  • Both commands run by hand against a missing folder print the message and exit 1.

Patch releases of h5p-embed and h5p-normalize when the next release goes out.


Summary by cubic

h5p-embed --scorm and h5p-normalize -o now refuse an output whose folder does not exist or is a file, before any work starts.

Previously, h5p-embed --scorm crashed with an uncaught ENOENT stack trace after planning the whole zip, and h5p-normalize blamed an entry for a mid-write failure. Both now exit 1 with No such folder: <folder>. or <folder> is a file, not a folder.

h5p-author build and bundle already refused such outputs, and h5p-embed <folder> and h5p-author read create the folder, so those are unchanged. The fix ships in the next patch releases of h5p-embed and h5p-normalize.

Written for commit e3c76b2. Summary will update on new commits.

View guided diff Turn on auto-fix

…efused by name (#290)

`h5p-embed --scorm quiz.h5p missing/out.zip` ended in an uncaught ENOENT
with a stack trace, after the whole zip had been planned, and
`h5p-normalize -o missing/out.h5p` blamed h5p.json. Both now check the
folder before any work and say which folder is missing.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/embed/lib/scorm.mjs Resolved
Comment thread packages/normalize/lib/normalize.mjs Resolved
@alekswebnet
alekswebnet merged commit b763732 into main Nov 26, 2026
12 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.

h5p-embed --scorm crashes when the zip's folder does not exist

1 participant