-
Notifications
You must be signed in to change notification settings - Fork 623
Open
Description
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;
Metadata
Metadata
Assignees
Labels
No labels