You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module has been great to me. I appreciate all the hard-work that has gone into it. I've been really happy with how it solves that email problem for my Node.js application.
I've been facing an issue when I began to update the versions of email-templates and node-sass to the latest versions as specified within the ReadMe: ^2.3.0 and ^3.5.3 respectively.
The issue lies in an edge-case where if I'm testing the .render method for the EmailModule repeatedly in a suite of tests. The first test will work, but on the second test, there will be a sort of "string collision" where for node-sass, instead of receiving an array, it receives a string that has been concat-ed and causing the following error:
error: TypeError: (options.includePaths || []).join is not a function
at getOptions (/this/node-project/node_modules/node-sass/lib/index.js:181:55)
at Object.module.exports.render (/this/node-project/node_modules/node-sass/lib/index.js:268:13)
at /this/node-project/node_modules/email-templates/lib/template-manager.js:126:10
at renderSass (/this/node-project/node_modules/email-templates/lib/template-manager.js:124:10)
at /this/node-project/node_modules/email-templates/lib/template-manager.js:63:22
From previous event:
at render (/this/node-project/node_modules/email-templates/lib/template-manager.js:45:10)
at renderFile (/this/node-project/node_modules/email-templates/lib/util.js:53:38)
at /this/node-project/node_modules/email-templates/lib/email-template.js:200:38
From previous event:
at EmailTemplate._renderStyle (/this/node-project/node_modules/email-templates/lib/email-template.js:188:14)
at /this/node-project/node_modules/email-templates/lib/email-template.js:146:97
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
...
If I were to console.log what the value of options.includePaths is at line 180, it is the following:
Note that on the second test, it isn't an array anymore, but a string that has concat-ed both strings of location of the template, thus resulting in the error of the .join() not working.
I'm honestly not entirely sure if it is on the node-email-templates end, or whether it is a node-sass issue - but I wanted to bring up. In either case, I'm going to be making sure that the versions I use are now static:
node-sass: 3.4.1
email-templates: 2.0.1
Those versions have worked for me on my suite of tests and the like. Below are all the specifications of which node versions I'm using and how it is implemented:
~$ node -v
v4.2.6
~$ npm -v
v2.14.12
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
I wrote up the simplest test example that will demonstrate the issue, but to include all necessary files seems outside the scope of this Issue:
/* global describe, it, beforeEach */
/* jshint expr: true */
'use strict';
var chai = require('chai'),
expect = chai.expect,
path = require('path'),
template_name = 'test-notification-email',
EmailTemplate = require('email-templates').EmailTemplate;
chai.use(chaiAsPromised);
var mockData = {
"title": "Mock Data Title",
"body": "This is the body of the mock data object"
};
describe('Testing Render Methods', function() {
beforeEach(function() {
this.instance = EmailTemplate;
});
describe('Test one', function() {
it('should render html', function(done) {
var template_loc = path.join(__dirname, '/../', 'templates', template_name);
var email_template = new this.instance(template_loc);
email_template.render(mockData, function(err, rendered) {
if (err) return;
expect(rendered["html"]).to.not.be.empty;
done();
});
});
});
describe('Test two', function() {
it('should render html and not error out, but it will', function(done) {
var template_loc = path.join(__dirname, '/../', 'templates', template_name);
var email_template = new this.instance(template_loc);
email_template.render(mockData, function(err, rendered) {
if (err) return;
expect(rendered["html"]).to.not.be.empty;
done();
});
});
});
});
If you've reached this far, thank you very much for your time and keep up the great work. :)
The text was updated successfully, but these errors were encountered:
Hello,
This module has been great to me. I appreciate all the hard-work that has gone into it. I've been really happy with how it solves that email problem for my Node.js application.
I've been facing an issue when I began to update the versions of
email-templates
andnode-sass
to the latest versions as specified within the ReadMe:^2.3.0
and^3.5.3
respectively.The issue lies in an edge-case where if I'm testing the
.render
method for theEmailModule
repeatedly in a suite of tests. The first test will work, but on the second test, there will be a sort of "string collision" where fornode-sass
, instead of receiving an array, it receives a string that has been concat-ed and causing the following error:If I were to
console.log
what the value ofoptions.includePaths
is at line 180, it is the following:1st iteration - 1st test
2nd iteration - 2nd test
Note that on the second test, it isn't an array anymore, but a string that has concat-ed both strings of location of the template, thus resulting in the error of the
.join()
not working.I'm honestly not entirely sure if it is on the
node-email-templates
end, or whether it is anode-sass
issue - but I wanted to bring up. In either case, I'm going to be making sure that the versions I use are now static:Those versions have worked for me on my suite of tests and the like. Below are all the specifications of which node versions I'm using and how it is implemented:
I wrote up the simplest test example that will demonstrate the issue, but to include all necessary files seems outside the scope of this Issue:
If you've reached this far, thank you very much for your time and keep up the great work. :)
The text was updated successfully, but these errors were encountered: