question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mailgun 3.4.0 APIResponse failing tsc

See original GitHub issue

Overview

The commit Fix merge problem. Fix eslint errors. causes an error during Typescript compilation. The APIResponse needs to be exported to allow methods in domains.ts to use it in type hints (implicilty).

The Error

lib/domains.ts:126:3 - error TS4053: Return type of public method from exported class has or is using name 'APIResponse' from external module "C:/Users/ruane/OneDrive/dev/mailgun-js/lib/request" but cannot be named.

126   assignIp(domain: string, ip: string) {
      ~~~~~~~~

lib/domains.ts:130:3 - error TS4053: Return type of public method from exported class has or is using name 'APIResponse' from external module "C:/Users/ruane/OneDrive/dev/mailgun-js/lib/request" but cannot be named.

130   deleteIp(domain: string, ip: string) {
      ~~~~~~~~

lib/domains.ts:134:3 - error TS4053: Return type of public method from exported class has or is using name 'APIResponse' from external module "C:/Users/ruane/OneDrive/dev/mailgun-js/lib/request" but cannot be named.

134   linkIpPool(domain: string, pool_id: string) {
      ~~~~~~~~~~

lib/domains.ts:138:3 - error TS4053: Return type of public method from exported class has or is using name 'APIResponse' from external module "C:/Users/ruane/OneDrive/dev/mailgun-js/lib/request" but cannot be named.

138   unlinkIpPoll(domain: string, pool_id: string, ip: string) {
      ~~~~~~~~~~~~

What’s causing the issue?

interface APIResponse {
  status: number;
  body: any;
}

How to fix the issue:

export interface APIResponse {
  status: number;
  body: any;
}

Steps to reproduce:

  1. Check out 3.4.0 or master.
  2. Run npm install
  3. Run tsc

Workaround for those using mailgun.js as dependency:

Downgrade to Mailgun.js 3.3.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Vaakmeistercommented, Jul 8, 2021

Seems like the issues were resolved. Thank you.

0reactions
olexandr-mazepacommented, Jul 8, 2021

@Vaakmeister I fixed the import in v3.5.1. Hope I resolved all compiling errors if not please let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check send() response for failure in v3.0 #635 - GitHub
When the Mailgun SDK gets a valid status code (AKA 200 or 201) then we hydrate the response object with the class that...
Read more >
API Issues - Mailgun Help Center
There's a problem. It appears one of our services is having difficulty. Documentation. Our elegant API docs answer lots of questions.
Read more >
mailgun.js - npm
A javascript sdk for Mailgun built with webpack, babel & es6. This can be used in node or in the browser*.. Latest version:...
Read more >
Unable to send mail via Mailgun over api or smtp
But each time the send command (both curl and smtp) I get "Mailgun Magnificent API" response - but no mail is delivered. So...
Read more >
how to send post request curl Code Example - Code Grepper
If it still fails, a git process may have crashed in this repository earlier: ... npm WARN deprecated uuid@3.4.0: Please upgrade to version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found