Skip to content

Consider an opt-in flag to treat PKG_NOT_ON_DISK & PKG_NOT_FOUND fatal #10058

Description

@t3chguy

As per title, I don't see why a build is successful if some dependencies are missing. Opt-in or forced but with a config flag to "ignoreMissingDependency": ["x"] would be nice

My temporary (yet untested) workaround:

// Treat certain warnings as a fatal error
const FATAL_WARNINGS = [LogMessageByKey.PKG_NOT_ON_DISK, LogMessageByKey.PKG_NOT_FOUND];
// Otherwise we just burn time running the tests for no reason.
const prevTransform = log.messageTransformer;
log.messageTransformer = (message, level) => {
    if (level === "warn" && FATAL_WARNINGS.some((w) => message.startsWith(w))) {
        throw new Error(`electron-builder: ${message}`);
    }
    return prevTransform?.(message, level) ?? message;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions