amplitude / amplitude/ampli-examples

`Response not defined` error when disabling ampli on `load()`

Open
#100 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12
Forks
12
PR merge metrics
No merged PRs in 30d

Description

`ReferenceError: Response not defined` is thrown when ampli is loaded with `disabled: true` flag.

Steps to reproduce:
1. Call `ampli.load()` with `disabled: true`
2. Add a valid event to the tracking plan
3. Call on event with ampli to validate
4. ReferenceError is thrown

If `disabled` flag is switched to false, application behaves as expected

![ampli-code](https://user-images.githubusercontent.com/29579447/169800890-62a3f2b5-9ed7-45c8-9966-fd43dab05ef1.png)

Screenshot 2022-05-23 at 13 34 04

As I can see, the error originates in the `ampli/index.js` generated file. There on line 245 `Promise.resolve` has `` type, however that is not defined in js runtime. This throws an error. If I manually remove the `` from the line, application works as expected. But this is not an option since the file is overwritten on every use of `ampli pull`.

OS: macOS Monterey 12.3
Node version: 16.14.2
Ampli version: @amplitude/ampli/1.10.0 darwin-arm64 node-v12.22.12

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.