When using import Clockify from 'clockify-ts' in an .mjs file and trying to use it, I'm getting an error:
const test = new Clockify('');
^
TypeError: Clockify is not a constructor
My entire project setup:
index.mjs
import Clockify from 'clockify-ts';
const test = new Clockify('');
package.json
{
"main": "index.mjs",
"dependencies": {
"clockify-ts": "^1.2108.13"
},
"scripts": {
"start": "node ."
}
}
I can get this to work by using
import * as Clockify from 'clockify-ts';
const test = new Clockify.default.default(''); // doubled .default !!!
but I think you should fix your build config, because clearly something is wrong.
I see this was already reported in #12 - however the issue was resolved as OP thought it was a problem with his project config. I believe the problem lies in this library.
When using
import Clockify from 'clockify-ts'in an.mjsfile and trying to use it, I'm getting an error:My entire project setup:
index.mjs
package.json
{ "main": "index.mjs", "dependencies": { "clockify-ts": "^1.2108.13" }, "scripts": { "start": "node ." } }I can get this to work by using
but I think you should fix your build config, because clearly something is wrong.
I see this was already reported in #12 - however the issue was resolved as OP thought it was a problem with his project config. I believe the problem lies in this library.