Skip to content
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

Linux builds fail if nwbuild.linuxCfg is not set #699

Closed
1 of 3 tasks
sysrage opened this issue Nov 20, 2022 · 3 comments · Fixed by #729
Closed
1 of 3 tasks

Linux builds fail if nwbuild.linuxCfg is not set #699

sysrage opened this issue Nov 20, 2022 · 3 comments · Fixed by #729
Labels
bug Priority: 1

Comments

@sysrage
Copy link
Contributor

sysrage commented Nov 20, 2022

Issue Type

  • Bug Fix
  • Feature
  • Other

Current/Missing Behaviour

Optional chaining isn't being used, which causes a failure if nwbuild.linuxCfg is not defined:

file:///C:/Users/Brian/Documents/Code/nw-react/node_modules/nw-builder/src/bld/linuxCfg.js:20
  if (typeof pkg.nwbuild.linuxCfg === "object") {
                         ^

Expected/Proposed Behaviour

Use optional chaining:

if (typeof pkg.nwbuild?.linuxCfg === "object") {
@sysrage sysrage added the bug Priority: 1 label Nov 20, 2022
@ayushmanchhabra
Copy link
Collaborator

ayushmanchhabra commented Nov 20, 2022

Wow I literally remember doing that, must have made a typo
I'm not able to reproduce this, it builds for me. Have tried on the latest commit?

@sysrage
Copy link
Contributor Author

sysrage commented Nov 21, 2022

So, it's actually even worse than just the missing optional chaining. This fails if you don't have nwbuild defined in package.json at all. I'm running this by passing all configuration objects as a parameter, not via CLI. If you don't have an nwbuild property in package.json, you get the error above. If you have nwbuild (even if it's an empty object), you still get the error above unless you have a linuxCfg prop or add the optional chaining fix.

Please fix this so you don't need nwbuild in package.json at all. The linuxCfg property should be optional, whether you're using package.json or passing a configuration object as a parameter to nwbuild().

Edit: Second half of this is that you need to allow specifying linuxCfg as part of the configuration object passed to nwbuild(). As a workaround to the above issue, I tried adding this property but it didn't work.

@ayushmanchhabra
Copy link
Collaborator

Edit: Second half of this is that you need to allow specifying linuxCfg as part of the configuration object passed to nwbuild(). As a workaround to the above issue, I tried adding this property but it didn't work.

linuxCfg as a nwbuild option definitely makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Priority: 1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants