simonhochrein / meteor-mjml

A MJML rendering helper for Meteor.js
11 stars 4 forks source link

Error: ENOENT: no such file or directory, open './mjml/body.mjml' #4

Open bolognese opened 6 years ago

bolognese commented 6 years ago

/.meteor/packages/meteor-tool/.1.6.0_1.obe9u1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280

Error: ENOENT: no such file or directory, open './mjml/body.mjml' (STDERR) at Object.fs.openSync (fs.js:646:18) (STDERR) at Object.fs.readFileSync (fs.js:551:33) (STDERR) at new MJML (packages/simonhochrein:mjml/mjml.js:11:24) (STDERR) at emails.js (server/emails.js:1:13) (STDERR) at fileEvaluate (packages/modules-runtime.js:343:9) (STDERR) at require (packages/modules-runtime.js:238:16)

I'm getting this error while following the exact example given in the readme.

/server/emails.js

var email = new MJML('./mjml/body.mjml'); email.helpers({ message: "hello world" }); email.send({ to: "to@email", from: "from@email", subject: "Hello World" });

/server/mjml/body.mjml

`

{{message}}

`

simonhochrein commented 6 years ago

I will be working on this package soon. There is a new update that fixes a handlebars package issue. In the mean time you could use Npm.require('path').resolve('.').split('.meteor')[0]+'/server/mjml/body.mjml' until I get around to fixing it.

Thanks