When using gm with meteor.js you may need to import gm in files that are used on both client and server. This way on the client you'll get an error: require(...).readFileSync is not a function even if you don't actually try to use gm.
This comes from this code in index.js:
module.exports.version = JSON.parse(
require('fs').readFileSync(__dirname + '/package.json', 'utf8')
).version;
fs module on the client is an empty object which triggers an error. Can this be replaced with something like this?
module.exports.version = JSON.parse(
require('fs').readFileSync
&& require('fs').readFileSync(__dirname + '/package.json', 'utf8')
|| "{}"
).version;
When using
gmwith meteor.js you may need to import gm in files that are used on both client and server. This way on the client you'll get an error:require(...).readFileSync is not a functioneven if you don't actually try to use gm.This comes from this code in
index.js:fsmodule on the client is an empty object which triggers an error. Can this be replaced with something like this?