nx-electron
nx-electron copied to clipboard
Upgrade to nx@14
Is your feature request related to a problem? Please describe. github pipeline fail with:
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm ERR! code 1
npm ERR! path /home/runner/work/easyBSB/easyBSB/node_modules/nx-electron/node_modules/nx
npm ERR! command failed
npm ERR! command sh -c node ./bin/init
npm ERR! > NX Cannot read properties of undefined (reading 'endsWith')
...
This happens for the simple reason we have installed nx@14 but nx-electron use nx@13
Describe the solution you'd like upgrade deps to [email protected]
Describe alternatives you've considered As workarround what helps for now is to override inside the package.json the deps of nx-electron and it seems to work.
{
...
},
"overrides": {
...
"nx-electron": {
"@nrwl/devkit": "14.1.9",
"@nrwl/workspace": "$@nrwl/workspace"
}
}
}
Additional context Fun part here, we test this on multiple local systems it was working. Because maybe npm cache or something else i do not know. It only failed inside ci pipeline and gitpod.
Problem seems to be solved with version 13.2.1 so i think i can close this issue. Thx for the good work :)
I'm still having the same problem even with the v13.2.1
with nx v14.1.9
.
Anyone an Idea what else could be the problem?
yeah was a mistake forgot to run npm i again, so it takes the wrong package-lock.json with nx@14 as depdenceny. It currently seems only to work if we override this inside the package.json.
@lailo The problem in my case was the missing root
property in the project.json
files. For instance, if the sourceRoot
is apps/my-app/src
, you need to add the root
property apps/my-app
.
It works fine after adding this property. I am using version 2 of the angular.json
file.
Has anyone had success with nx@14? Unfortunately, updating npm to v8 to make use of overrides
is not an option for me.
EDIT: "It's working fine for me out of the box with NX v14."
UPDATE: It was working fine locally but as mentioned it only breaks in my Github Actions CI pipeline.
The overrides solution don't work for me :'( got the same problem on my pipeline
Still doesn't work, steps to reproduce
- Using nvm to install node v16.17.0
- Install nx using npx create-nx-workspace@latest somename (use new workspace for apps option). This creates workspace with version v14.5.8
- run npm i -D @nrwl/react
- run nx g @nrwl/react:app some app (installed react router and styled-components for style)
- run nx build and nx serve to make sure the default react app works
- run npm install -D nx-electron, get the following error `.... npm ERR! command failed npm ERR! command sh -c -- node ./bin/init npm ERR! > NX Cannot read properties of undefined (reading 'endsWith')
npm ERR! A complete log of this run can be found in: ...`
Seems like out of the box nx-electron is referring to [email protected]
did anybody found solution to this problem. I have the same issue.... but in my case the app is blank and I get a different error image below.
Here is the image of the error.
The app looks completely blank
@daiky00 it looks like the problem is that your front-end hasn't been started, no? it says that electron can't load http://localhost:4200.
@sviatoslav-lebediev I didn't know you needed to start the frontend project though? it works after starting my frontend project in another terminal but that feels weird. is that how is suppose to be? and also I am wondering how is that suppose to work when you deploy the app to production so that people can downloaded it?
@daiky00 usually I run it in this way nx run-many --target=serve --projects=cfl-main,cfl-renderer --parallel
but I have a few electron apps in the same repo. So I don't know if you can just run your app as nx serve
. As for the second question - take a look at the loadMainWindow
method. In dev mode, it will load a URL but for the packaged version will load a bundled index.htm
Please use the discussions section for that so other people could take advantage of you conversation. The issues section should be used for bug reports only.
Testing my steps on node v14.17.5, doing the same steps I posted above still no success, npm install -D nx-electron seems to be hanging at
...
[email protected] postinstall /Users/srinath.n/tsc3.0/itshinni-workspace/node_modules/nx-electron/node_modules/nx node ./bin/init
Experiencing the same issue, but the "overrides" solution didn't work for me. As a temporary solution, I updated my package.json to have:
"nx-electron": "https://github.com/bennymeg/nx-electron#feature/v14",
Since I noticed there's a v14 branch in the works. This fixed it for me. I wouldn't recommend this for production code, but in my case, it unblocked me for now, and I hope soon enough we have official v14 support.
@isaacpalka There is an v14-alpha version on npm.
14.0.0-alpha.1 isn't packaging my front-end app, resulting in a blank window when booting the app. Any ideas on remedying this? My build works perfectly on 13.2.1.
Same issue here, nx-electron works well with nx 14.5.10 but crash at post-install with nx 14.7.13...
@bennymeg when can we expect v14 upgrade?
@alljinx nx-electron v13 is only compatible with nx v13? which version are you using? @dhrn once I understand if the alpha is broken or if the problem is version mixing.
@bennymeg nx-electron 13.2.1 and nx 14.5.10 seems to works like a charm in my project...
@bennymeg When do you expect v14 to drop?
Nx v15 has been released. So I'm starting to worry about being 2 major releases late...
just curious to know the progress on this @bennymeg
Released!