forge icon indicating copy to clipboard operation
forge copied to clipboard

Electron Forge 7.0.0 and newer does not handle correctly older `@electron-forge/maker-base` and third-party makers.

Open SpacingBat3 opened this issue 7 months ago • 2 comments

Pre-flight checklist

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

Electron Forge version

7.0.0 and newer

Electron version

(irrelevant, this is a Forge issue)

Operating system

(irrelevant, the issue is not associated with any platform-specific code in Forge)

Last known working Electron Forge version

6.x.y

Expected behavior

When there's an older and incompatible maker-base used by a maker, Forge should gracefully handle such case by like implementing a backwards compatibility logic for them or ignoring makers that use too old maker-base class and warning end-users about this.

Actual behavior

Electron Forge does quite a naive check for makers in order to verify if they are actually makers. This is currently problematic when extending Forge by own makers' implementation and causes stuff to happen like this: https://github.com/SpacingBat3/ReForged/issues/12.

Steps to reproduce

  1. Install a maker depending on maker-base:^6.0.0 (i.e. anything older than 7.0.0).
  2. Install Forge 7.0.0 or newer.
  3. Configure it to use the maker.
  4. See an uncaught exception pointing to the use of .clone method (it is very likely undefined in older maker-base versions, or at least not a function) in this line (the commit in permalink is the exact commit that introduces this regression): https://github.com/electron/forge/blob/7370d6e9e3e08be22e169c6712144ff24b08ecee/packages/api/core/src/api/make.ts#L185

Additional information

Related commit: https://github.com/electron/forge/commit/7370d6e9e3e08be22e169c6712144ff24b08ecee Related PR: https://github.com/electron/forge/pull/3363


This issue could also be associated with another API components, like publishers and plugins (I haven't checked how Forge handles detection of them).

SpacingBat3 avatar Nov 25 '23 00:11 SpacingBat3