forge icon indicating copy to clipboard operation
forge copied to clipboard

Error: Multiple plugins tried to take control of the start command, please remove one of them --> vite, fuses

Open cmxela opened this issue 1 year ago • 8 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.4.0

Electron version

31.1.0

Operating system

Fedora Linux 40

Last known working Electron Forge version

No response

Expected behavior

being able to start the application just after creating it from a template

Actual behavior

executing electron-forge start just after executing

npm init electron-app@latest gato-vue -- --template=vite-typescript

is producing this output

✔ Checking your system
✔ Locating application
✔ Loading configuration
✔ Preparing native dependencies [0.1s]
✔ Running generateAssets hook

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

An unhandled rejection has occurred inside Forge:
Error: Multiple plugins tried to take control of the start command, please remove one of them
 --> vite, fuses
at PluginInterface.overrideStartLogic (/home/alexmc/.local/share/nvm/v22.3.0/lib/node_modules/@electron-forge/cli/node_modules/@electron-forge/core/src/util/plugin-interface.ts:150:13)
    at forgeSpawn (/home/alexmc/.local/share/nvm/v22.3.0/lib/node_modules/@electron-forge/cli/node_modules/@electron-forge/core/src/api/start.ts:128:66)
    at forgeSpawnWrapper (/home/alexmc/.local/share/nvm/v22.3.0/lib/node_modules/@electron-forge/cli/node_modules/@electron-forge/core/src/api/start.ts:200:29)
    at /home/alexmc/.local/share/nvm/v22.3.0/lib/node_modules/@electron-forge/cli/node_modules/@electron-forge/core/src/api/start.ts:235:27
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/alexmc/.local/share/nvm/v22.3.0/lib/node_modules/@electron-forge/cli/node_modules/@electron-forge/tracer/src/index.ts:51:14
    at async /home/alexmc/.local/share/nvm/v22.3.0/lib/node_modules/@electron-forge/cli/src/electron-forge-start.ts:61:19

Steps to reproduce

described in the actual behaviour

Additional information

No response

cmxela avatar Jul 05 '24 09:07 cmxela

This problem does not happen if instead of using 'electron-forge startI usenpm start`

cmxela avatar Jul 05 '24 09:07 cmxela

Hey @cmxela! My guess it that the version of electron forge you're hitting when you run electron-forge start is out of date with the version of forge in your dev dependencies. Can you verify if that's the case by running npx electron-forge --version in /gato-vue and running npx electron-forge --version from your home dir and comparing the outputted versions?

yangannyx avatar Jul 09 '24 03:07 yangannyx

Hi @yangannyx thanks for your reply, no, this is not the case

   ~/gato/gato/gato-frontend   master !279 ?6  npx electron-forge --version                                                          ✘ 1 
✔ Checking your system
7.4.0
    ~/gato/gato/gato-frontend   master !279 ?6  cd                                                                                      ✔ 
    ~  npx electron-forge --version                                                                                                       ✔ 
✔ Checking your system
7.4.0
    ~         ```


cmxela avatar Jul 13 '24 16:07 cmxela

I got the same problem, in my case it was caused by npm installing @electron-forge/plugin-base inside both @electron-forge/plugin-fuses and @electron-forge/core instead of hoisting it, which caused problems with how electron detects if plugins have implemented the startLogic function (the prototype wasn't identical).

I solved it by adding and then removing @electron-forge/plugin-base, which probably cleaned up my lockfile.

ToshB avatar Aug 06 '24 14:08 ToshB

I think I got the same. Windows, just created a new project with this

npm init electron-app@latest electrontstest -- --template=webpack-typescript

and then simply

npx electron-forge start

error I've got:

An unhandled rejection has occurred inside Forge: Error: Multiple plugins tried to take control of the start command, please remove one of them --> auto-unpack-natives, webpack, fuses at PluginInterface.overrideStartLogic (C:\Users\ProjectC\electrontstest\node_modules@electron-forge\core\src\util\plugin-interface.ts:150:13)
at forgeSpawn (C:\Users\ProjectC\electrontstest\node_modules@electron-forge\core\src\api\start.ts:128:66) at forgeSpawnWrapper (C:\Users\ProjectC\electrontstest\node_modules@electron-forge\core\src\api\start.ts:200:29) at C:\Users\ProjectC\electrontstest\node_modules@electron-forge\core\src\api\start.ts:235:27 at processTicksAndRejections (node:internal/process/task_queues:95:5) at async C:\Users\ProjectC\electrontstest\node_modules@electron-forge\tracer\src\index.ts:51:14 at async C:\Users\ProjectC\electrontstest\node_modules@electron-forge\cli\src\electron-forge-start.ts:61:19

shawhu avatar Aug 07 '24 00:08 shawhu

@shawhu I have the exact same error you've got. Did you find any solutions? I'm very new to TS-electron projects.

ianbloc avatar Sep 22 '24 19:09 ianbloc

I encountered this issue when adding @electron-forge/plugin-fuses and @electron-forge/plugin-vite to my project in the same npm install command.

I was able to fix the error by removing the plugins, then npm install-ing them one at a time..

Angelnorn avatar Oct 08 '24 16:10 Angelnorn

I encountered this issue when adding @electron-forge/plugin-fuses and @electron-forge/plugin-vite to my project in the same npm install command.

I was able to fix the error by removing the plugins, then npm install-ing them one at a time..

I had been trying to do the same, but it didn't work. I remove the packages from package.json, run npm install, then add one by one, run npm install, in any order the result is the same.

FominArtmind avatar Oct 21 '24 07:10 FominArtmind

For future reference for anyone: I found I had this same issue however the reason being seems to have been because the vite plugin and the fuses plugin were both on different versions (one on 7.4.0 and one on 7.5.0). Updating them both to 7.5.0 fixed this.

C0mplexity0 avatar Nov 20 '24 10:11 C0mplexity0

^ making sure all your electron-forge deps are the same version worked for me

timeowilliams avatar Dec 18 '24 16:12 timeowilliams

I think I'm going to close this since the solution just seems to be keeping all package versions up to date with each other.

There's potentially a follow-up to be made to warn users if mismatched versions are detected?

erickzhao avatar Jan 31 '25 02:01 erickzhao