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

Electron builder fails due to trailing comma in dependency package.json #128

Open
drclementshimizu opened this issue Aug 2, 2024 · 0 comments

Comments

@drclementshimizu
Copy link

I previously filed this bug with electron builder, but the issue was with app-builder.

Electron-Builder Version:
^24.13.3
Node Version:
10.7.0
Electron Version:
Electron Type (current, beta, nightly):
26.0.0
Target:
windows
Electron builder fails when there is a trailing comma in a package.json.
this is not allowed in json, but many systems are able to overlook it, because javascript allows it.

for example, a NPM dependency of a project's package.json has a trailing comma. and this produces a difficult to interpret error
https://www.npmjs.com/package/Babel

electron-builder

• electron-builder version=24.13.3 os=10.0.22631
• loaded configuration file=package.json ("build" field)
• description is missed in the package.json appPackageFile=MYAPP\package.json
• writing effective config file=dist\builder-effective-config.yaml
⨯ node_modules.Dependency.ReadString: expects " or n, but found }, error found in electron-userland/electron-builder#10 byte of ...|.x"
},
}|..., bigger context ...| "step": "0.0.x",
"underscore": "1.x.x"
},
}|...
Error reading package.json: MYAPP\node_modules\Babel\package.json

I was able to fix my error by ensuring the node_modules\Babel\package.json has no trailing commas

However, just a request to make that work without having to police my dependencies...

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

No branches or pull requests

1 participant