matomo-org / matomo-org/matomo-nodejs-tracker

Import error: TypeError: Vn is not a constructor

Open
#72 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
117
Forks
41
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported `import * as MatomoTracker from "matomo-tracker"` usage in the build pipeline and compare it with the working `require` form. Investigate the package's module and bundling entry points; done means the package bundles successfully and the imported tracker can be constructed without the runtime TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.