This is a
exports.version = require('./package').version;
TypeError: Cannot read property 'version' of null
It looks like this line should be corrected to require('./package.json').version or loading of json files as js files explicitly enabled in rollup/webpack
Sorry, Working on resolving this -- #418
To clarify, it works if you use require("./package.json")?
Heya - it's not actually something I'm doing. Appears to be nexe.
I tried creating package.js to fool it and just exporting the contents of package.json module.exports = require('package.json') but to no avail.
Okay, Here is a workaround to bypass the bundler
nexe entry-file.js --bundle ./nexe-bundle.js
and nexe-bundle.js (requires two dependencies pify and webpack
const webpack = require('pify')(require("webpack"))
const fs = require('fs')
module.exports.createBundle = function (options) {
return webpack({
entry: options.input,
target: 'node',
output: { filename: 'tmp.js' }
}).then(() => {
const result = fs.readFileSync('./tmp.js').toString()
fs.unlinkSync('./tmp.js')
return result
})
}
Thanks for that :)
Most helpful comment
Okay, Here is a workaround to bypass the bundler
nexe entry-file.js --bundle ./nexe-bundle.jsand
nexe-bundle.js(requires two dependenciespifyandwebpack