fix: throw a descriptive error when the out dir would exclude the app from packaging#1928
Open
claude[bot] wants to merge 2 commits into
Open
fix: throw a descriptive error when the out dir would exclude the app from packaging#1928claude[bot] wants to merge 2 commits into
claude[bot] wants to merge 2 commits into
Conversation
… from packaging Out directories are automatically excluded from the packaged app. When the out dir is the app dir itself, or is a subdirectory of the app dir that contains the app's main entry point, packaging failed with a misleading "Application manifest was not found" or "The main entry point to your app was not found" error that blamed the ignore option. validateElectronApp now receives the resolved ignored out dirs and throws a targeted error explaining that the out dir is excluded from packaging and must live outside the app source. Fixes #1685
Use realpath-canonicalized paths and a path.relative-based containment check so the out-dir detection works across symlinked paths (e.g. /var vs /private/var in macOS tmpdirs) and case-insensitive filesystems. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RX3wGLrrpx1fBfqXCZt1Tx
993460d to
58f5670
Compare
MarshallOfSound
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Samuel Attard · Slack thread
Summarize your changes:
Before: if the
outdirectory resolved to a location inside the app source — e.g.main: "dist/code.js"inpackage.jsonwith--out ./dist, or--outpointing at the app directory itself — the out directory was silently excluded from the copy (out dirs are always excluded from packaging), and the user got a misleading error blaming their ignore option:The main entry point to your app was not found. Make sure "..." exists and does not get ignored by your ignore option(or theApplication manifest was not foundvariant whenoutequalsdir).After: packaging fails with a targeted error that explains the actual problem, e.g.:
and, when
outis the app directory itself:How:
App.buildApp(src/platform.ts) now passes the resolved ignored out dirs (fromgenerateIgnoredOutDirsinsrc/copy-filter.ts) intovalidateElectronApp(src/common.ts). When validation fails and the missing manifest/main entry point falls inside an ignored out dir, the new targeted error is thrown instead of the generic one; behavior is unchanged for every configuration that packages successfully today. Covered by new unit tests intest/common.spec.ts(plus a new fixture) and end-to-end tests intest/packager.spec.tsfor both the out-dir-contains-main-entry-point and out-equals-dir cases.Fixes #1685