Revert the static assignment to the version variable introduced by #111 and once again call getVersion() to read it from package.json.
Update getVersion() to return a value from the catch handler so errors here do not crash the entire process. Returning undefined from getVersion() was the ultimate cause of #110.
Construct the path to package.json using process.pkg.defaultEntrypoint if it exists, in order to support the binary build system.
The build system was updated to:
include package.json in the binary snapshot file system
change the extension of the CommonJS bundled code to .cjs so it is processed as CommonJS when in the snapshot filesystem. Our package.json includes {"type": "module"}, so using the previous name bundle.js caused node to attempt to process that file as ESM and fail.
version
variable introduced by #111 and once again callgetVersion()
to read it frompackage.json
.getVersion()
to return a value from the catch handler so errors here do not crash the entire process. Returningundefined
fromgetVersion()
was the ultimate cause of #110.package.json
usingprocess.pkg.defaultEntrypoint
if it exists, in order to support the binary build system.The build system was updated to:
package.json
in the binary snapshot file system.cjs
so it is processed as CommonJS when in the snapshot filesystem. Ourpackage.json
includes{"type": "module"}
, so using the previous namebundle.js
caused node to attempt to process that file as ESM and fail.