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

Import error: TypeError: Vn is not a constructor #72

Open
Dominic-Marcelino opened this issue Jul 5, 2022 · 2 comments
Open

Import error: TypeError: Vn is not a constructor #72

Dominic-Marcelino opened this issue Jul 5, 2022 · 2 comments

Comments

@Dominic-Marcelino
Copy link

Due to our build-pipeline we can't use require to include the module. Using require it would't get bundled into the final build.

If we try to use import (import * as MatomoTracker from "matomo-tracker"; ) we can bundle it correctly but it throws an error on runtime: TypeError: Vn is not a constructor

Is there anything we can do?

Thanks a lot

@Findus23
Copy link
Member

Findus23 commented Jul 5, 2022

Have you tried using the beta version?
https://www.npmjs.com/package/matomo-tracker

It is using typescript and assuming I published it correctly (#64), it should probably work better with imports.

@Dominic-Marcelino
Copy link
Author

VsCode displays an error related to the construct signature, but except from that it seems to work! (from the first tests)

Now importing it via import MatomoTracker from "matomo-tracker";

The TS-Error in VsCode:

This expression is not constructable.
  Type 'typeof import("/Users/dominic/Code/_directus-extensions/directus-extension-application-monitoring/node_modules/matomo-tracker/index")' has no construct signatures.ts(2351)

michael-scheurer added a commit to michael-scheurer/matomo-nodejs-tracker that referenced this issue Nov 27, 2022
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

2 participants