Skip to content

typescript TypeError: js_schema_1.default is not a function #49

Description

Following TypeScript code

import {Schema} from 'js-schema';
import schema from 'js-schema';

let obj: Schema = schema({ foo: String, bar: String });

is transpiled into followin JS code

var js_schema_1 = require('js-schema');
var obj = js_schema_1.default({ foo: String, bar: String });

which leads to the error

TypeError: js_schema_1.default is not a function

How do I prevent transpiling this default-property?

I found a similar issue here: microsoft/TypeScript#5565

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions