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

Response not defined error when disabling ampli on load() #100

Open
ivanThePleasant opened this issue May 23, 2022 · 0 comments
Open

Response not defined error when disabling ampli on load() #100

ivanThePleasant opened this issue May 23, 2022 · 0 comments

Comments

@ivanThePleasant
Copy link

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

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 <Response> type, however that is not defined in js runtime. This throws an error. If I manually remove the <Response> 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

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