Skip to content

getting this error - JsExcelTemplate.formFile is not a function. #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
chirag80 opened this issue Jan 20, 2018 · 1 comment
Open
Labels

Comments

@chirag80
Copy link

Version(if relevant): 2.0.2

Environment(if relevant):

Code(if relevant):

// code here
var JsExcelTemplate = require("../../node_modules/js-excel-template/nodejs/nodejs");
const excelTemplate = JsExcelTemplate.fromFile("test.xlsx");

Expected:

Actual:

@plantain-00
Copy link
Owner

The JsExcelTemplate is a default export, you can use like:

import JsExcelTemplate from "js-excel-template/nodejs/nodejs";

or

const JsExcelTemplate = require("js-excel-template/nodejs/nodejs").default;

reference: microsoft/TypeScript#2719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants