forge icon indicating copy to clipboard operation
forge copied to clipboard

the main entry point to your app was not found

Open funny-cat-happy opened this issue 1 year ago • 1 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.2.0

Electron version

v21.4.4

Operating system

win11

Last known working Electron Forge version

No response

Expected behavior

build package successfully

Actual behavior

raise exception

An unhandled rejection has occurred inside Forge:
Error: The main entry point to your app was not found. Make sure "E:\PandaChat\dist\main\index.js" exists and does not get ignored by your ignore option   
at validateElectronApp (E:\PandaChat\node_modules\@electron\packager\dist\common.js:104:15)
    at async WindowsApp.buildApp (E:\PandaChat\node_modules\@electron\packager\dist\platform.js:123:9)
    at async WindowsApp.initialize (E:\PandaChat\node_modules\@electron\packager\dist\platform.js:117:13)
    at async WindowsApp.create (E:\PandaChat\node_modules\@electron\packager\dist\win32.js:110:9)
    at async Promise.all (index 0)
    at async packager (E:\PandaChat\node_modules\@electron\packager\dist\packager.js:237:22)

but the file indeed exist.

Steps to reproduce

  1. install electron forge
npm install --save-dev @electron-forge/cli
npx electron-forge import
  1. run make cammand and package.json's main including 'out' folder
npm run make
{
  "main": "./out/main/index.js",
}

Additional information

If I rename out folder to dist folder, the issue will be fixed. I deduced that it was a folder naming conflict. I would like to improve the error message.

funny-cat-happy avatar Dec 23 '23 11:12 funny-cat-happy