Closed nick-kang closed 1 month ago
Hello @nick-kang
While running npx tsc
on a project using this library, we have the following error:
The code is pretty simple:
var EmailForwardParser = require("email-forward-parser");
this.__email_forward_parser = new EmailForwardParser();
I haven't deeply checked it yet, any idea what would cause it?
On mobile rn, but my guess is that you'd have to add "constructor()" into the class definition.
Yes we tried both constructor()
and constructor() {}
, no luck.
It likely has to do with how tsconfig is setup. The library has been compiling fine on my end. Try importing as default like here: https://github.com/ajv-validator/ajv/issues/2204
Ok this makes the npx tsc
succeed, but throws the following error when we run the code:
this.__email_forward_parser = new EmailForwardParser.default();
^
TypeError: EmailForwardParser.default is not a constructor
Because obviously, there is no default
exported.
This is what our tsconfig.json
looks like:
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"target": "es6",
"types": ["node"],
"moduleResolution": "NodeNext",
"declaration": true,
"outDir": "dist",
"declarationMap": true
},
"include": ["src/**/*"]
}
Now released as version v1.7.0: https://www.npmjs.com/package/email-forward-parser/v/1.7.0
Thanks!