Skip to content

error when packageConfig.tmpdir set to false #1679

Closed

Description

@ianho

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.2.0

Electron version

27.1.2

Operating system

maxOS 13.2.1

Last known working Electron Forge version

No response

Expected behavior

no error when packageConfig.tmpdir set to false

Actual behavior

When packageConfig.tmpdir set to false, will get the error below:
Error: Cannot copy '/path/to/project' to a subdirectory of itself, '/path/to/project/out/AppName***/Electron.app/Contents/Resources/app'.

This error was thrown by fs-extra, whem electron-packager try to copy project to the out dir.

Thats caused by out dir is not allowed to set, so out dir must be a subdirectory

I want to take a PR for this, but there are 3 ways to fix it, I dont know we prefer which one

  1. when user set tmpdir to false, overwrite it to undefined, fix(core): error if tmpdir is false, overwrite to undefined forge#3476
  2. when user set tmpdir to false, throw an error by forge, fix(core): error if tmpdir is false, throw error forge#3477
  3. make electron-packager fix this problem, I also take a PR for this way: fix: copyTemplate failed if tmpdir set to false #1657

If we choose 1 or 2, I will take the PR soon

Steps to reproduce

set packageConfig.tmpdir to false
run forge package

Additional information

No response

Activity

  1. BlackHole1 commented on Jan 26, 2024

    @BlackHole1
    Member

    Thank you for your feedback. Personally, I am more inclined towards the third solution because the first two options are merely temporary measures that do not address the underlying issue.

  2. BlackHole1 commented on Feb 2, 2024

    @BlackHole1
    Member

    PTAL @electron/forgers

  3. erickzhao commented on Feb 21, 2024

    @erickzhao
    Member

    Discussed in an @electron/wg-ecosystem meeting, going with option 3 and moving this to packager.

  4. welcome commented on Feb 21, 2024

    @welcome

    👋 Thanks for opening your first issue here! If you have a question about using Electron Packager, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

    To help make it easier for us to investigate your issue, please follow the contributing guidelines.

  5. transferred this issue fromelectron/forgeon Feb 21, 2024
  6. added a commit that references this issue on Jul 3, 2026
    fa6e95c
  7. electron-npm-package-publisher commented on Aug 3, 2026

    @electron-npm-package-publisher

    🎉 This issue has been resolved in version 20.1.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions