bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
307 stars 82 forks source link

Brand new Electron app can not be packaged #267

Open faribauc opened 7 months ago

faribauc commented 7 months ago

Describe the bug Error: ENOENT: no such file or directory, open '/home/path/to/project/dist/apps/desktop-app-electron/index.js'

To Reproduce Steps to reproduce the behavior:

  1. npx create-nx-workspace@latest --preset=angular-monorepo --name=org --appName=renderer --e2eTestRunner=cypress --style=css --bundler=esbuild --nxCloud --ci=bitbucket-pipelines --ssr
  2. cd org
  3. npm install -D nx-electron
  4. nx g nx-electron:app electron --frontendProject=renderer --directory=desktop-app
  5. nx build renderer
  6. nx build desktop-app-electron
  7. run desktop-app-electron:package
  8. See error

The folder structure created by nx g nx-electron is apps/desktop-app/electron, not apps/desktop-app-electron.

Expected behavior The proper project path should be user.

Desktop (please complete the following information):

faribauc commented 7 months ago

Note that the goal here is to get an unassisted process working from A to Z.

You can get the expected behaviour by passing --directory="" instead.

bennymeg commented 7 months ago

The folder structure created by nx g nx-electron is apps/desktop-app/electron, not apps/desktop-app-electron.

The plugin currently depends on that all the applications reside directly under /apps --directory should be ..

faribauc commented 7 months ago

@bennymeg That was the first thing I tried, but that resulted in the project name being set to .-desktop-app. Using an empty string with --directory seems to have the same effect as just pressing Enter when asked by the CLI, which was the desired result.

And to your point, wouldn't that make the --directory option incompatible with the plugin?

bennymeg commented 7 months ago

Then it might be a change in the nx console. Whan version are you using? I will check it out.

faribauc commented 7 months ago

@bennymeg I'm using Nx 17.1.3

Thanks!