-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brand new Electron app can not be packaged #267
Comments
Note that the goal here is to get an unassisted process working from A to Z. You can get the expected behaviour by passing |
The plugin currently depends on that all the applications reside directly under |
@bennymeg That was the first thing I tried, but that resulted in the project name being set to And to your point, wouldn't that make the |
Then it might be a change in the nx console. |
@bennymeg I'm using Nx 17.1.3 Thanks! |
I know this is old but putting this here for anyone having this issue still. I found the root cause of this, and its an update to how angular builds its apps. the default angular builder even if your not using SSR creates a browser sub folder in the output directory. you have to make a change to 2 files in your angular project that the electron is using as its backend. #1 in the project.json change: #2 now at the ROOT of the repo in the package.json add:
with the appropriate names for your setup. sometimes you need to manually add electron-builder as a dev dependency as well. I'h had to randomly (not sure what causes this one) anyhow hope this helps anyone of the past, present and future as this is not an issue caused by the nx-electron plugin, it was introduced by angular themselves with version 17 |
See comment: #247 (comment) |
that has nothing to do with this, this is an issue caused by angular not NX or the plugin. Angular now puts the built files in a subfoler and that is why it can't find the files and why I posted my comment to this the first time.
Angular no longer uses this path that's the reason I posted how to change the way angular builds, which removes the sub folder and fixes the issue. due to angular supporting SSR, it puts the web files in a sub folder now, and the builder is not looking in that sub folder and can't find the files |
This is a plugin for a monorepo where the user can create its directory structure however he likes. How can the owner fixes a path like that? |
Just add the subfolder to App.mainWindow.loadURL(
pathToFileURL(
join(__dirname, '..', rendererAppName, 'browser', 'index.html')
).href
); The above (plus what is mentioned on the notes) should fix the issue. |
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:
npx create-nx-workspace@latest --preset=angular-monorepo --name=org --appName=renderer --e2eTestRunner=cypress --style=css --bundler=esbuild --nxCloud --ci=bitbucket-pipelines --ssr
cd org
npm install -D nx-electron
nx g nx-electron:app electron --frontendProject=renderer --directory=desktop-app
nx build renderer
nx build desktop-app-electron
run desktop-app-electron:package
The folder structure created by
nx g nx-electron
isapps/desktop-app/electron
, notapps/desktop-app-electron
.Expected behavior
The proper project path should be user.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: