Skip to content

ES modules syntax support? #124

@sekhavati

Description

@sekhavati

Hello 👋 We use TypeScript throughout our projects. Typically we use ES modules syntax (import/export) to load our modules, this then gets boiled down to CommonJS style (require) after the compiler has run.

It seems this module does not support use of the import/export syntax, is it suppose to?

For example we encounter these sorts of errors:

Working example:

const webhooks = require("gocardless-nodejs/webhooks");

webhooks.parse(...); // ok

Broken example:

import webhooks from "gocardless-nodejs/webhooks";

webhooks.parse(...); // => Runtime TypeError: Cannot read properties of undefined (reading 'parse')

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