es6-error: Unable to import using TypeScript on nodejs
In Typescript, this line:
import ExtendableError from 'es6-error'
translates to this line:
var ExtendableError = require('es6-error').default
However, .default
is undefined due to the incorrect way these two lines are written. A correct version of those two lines would read like this:
module.exports = ExtendableError;
module.exports.default = ExtendableError;
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 18 (3 by maintainers)
Commits related to this issue
- Workaround for babel transpilation issue with Typescript. See issue #29. — committed to jtlapp/es6-error by jtlapp 7 years ago
I suggest to change typedefinitions to
It would allows to
import * as ExtendableError from "es6-error"
, andimport ExtendableError from "es6-error"
with--allowSyntheticdefaultImports