segmentio / segmentio/analytics.js-integrations
Amplitude and Madkudu integrations break with SystemJS
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 125
- Forks
- 136
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 1
Description
When trying to initialize Amplitude Classic or Madkudu in a website using SystemJS, the initialization fails with the following message:
analytics.min.js:1 Madkudu TypeError: window.require is not a function
This is due to the fact that the condition on this line is true for SystemJS, but SystemJS does not define window.require (see here and here).
Maybe to the condition on line 13 a check should be added for window.require to be defined.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in integrations/madkudu/lib/index.js at line 13 and inspect the initialization path that runs when SystemJS is present. Verify the related Amplitude Classic behavior as well, then confirm that initialization under SystemJS no longer raises the reported window.require error while existing initialization paths still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100