Skip to content

__importDefault method may return an object with undefined default property #190

Description

@NealST

In my project, I use tslib as the helper library.
Today, I come across a mistake like this:
image

the error line code that generated by tsc is:

typedocApp = new typedoc_1.default.Application();

and typedoc_1 is defined like this:

var typedoc_1 = tslib_1.__importDefault(require("typedoc"));

So, I readed the code of __importDefault method in tslib:

 __importDefault = function (mod) {
        return (mod && mod.__esModule) ? mod : { "default": mod };
    };

If a mod has __esModule property but does not have default property, such as typedoc, the error described above will be fired.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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