Skip to content
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

Uncaught TypeError: Clockify is not a constructor #13

Open
Akatroj opened this issue Apr 23, 2023 · 0 comments
Open

Uncaught TypeError: Clockify is not a constructor #13

Akatroj opened this issue Apr 23, 2023 · 0 comments

Comments

@Akatroj
Copy link

Akatroj commented Apr 23, 2023

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.

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

No branches or pull requests

1 participant