Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

bug: createDnsRecord throws "undefined method `end_with?' for nil:NilClass" #107

@CanRau

Description

@CanRau

- Do you want to request a feature or report a bug?
This is a bug report

- What is the current behavior?
Trying to create DNS records using

const NetlifyAPI = require("netlify");
const client = new NetlifyAPI("TOKE");
(async () => {
  const dnsZone = await client.getDNSForSite({
    site_id: "SITE_ID",
  });
  await client.createDnsRecord({
    zone_id: dnsZone[0].id,
    type: record.type,
    hostname: record.name,
    value: record.value,
  });
})();

throws the following error

ERROR: JSONHTTPError: Internal Server Error
    at parseResponse ([..]/node_modules/netlify/src/methods/response.js:12:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async callMethod ([..]/node_modules/netlify/src/methods/index.js:38:26)
    at async [..]/netlify-create-dns.js:17:7 {
  name: 'JSONHTTPError',
  status: 500,
  json: { error: "undefined method `end_with?' for nil:NilClass" }
}

It's already been brought up in the community

- If the current behavior is a bug, please provide the steps to reproduce.
Using the code from above using a valid API token and correct site id found in https://app.netlify.com/sites/SITE_NAME/settings/general -> Site Information: APP ID

- What is the expected behavior?
Creation of DNS records.

- Please mention your node.js, and operating system version.
NodeJS v12.14.1, macOS 10.14.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions