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
test('xls report file should be created again', async () => {
let values = {
lastName: 'Тестов',
firstName: 'Тест',
middleName: 'Тестович',
};
const XlsxTemplate = require('xlsx-template');
// Load an XLSX file into memory
fs.readFile(path.join(__dirname, 'Book1.xlsx'), function(err, data) {
// Create a template
const template = new XlsxTemplate(data);
// Replacements take place on first sheet
const sheetNumber = 1;
// Set up some placeholder values matching the placeholders in the template
// Perform substitution
template.substitute(sheetNumber, values);
// Get binary data
const generated = template.generate();
fs.writeFileSync('B1.xlsx', generated, 'binary')
});
});
in Book1.xlsx - one simple string ${lastName} nothing more
then run this test you get:
Uncaught TypeError: this._factory is not a function
The text was updated successfully, but these errors were encountered:
In the offline chat we discover that changing fs.readFile to fs.readFileSync at least unblock the issue. so far there no conclusive reason why issue happens.
test('xls report file should be created again', async () => {
});
in Book1.xlsx - one simple string ${lastName} nothing more
then run this test you get:
Uncaught TypeError: this._factory is not a function
The text was updated successfully, but these errors were encountered: