power-assert-js / espower-typescript

power-assert instrumentor for TypeScript
https://npm.im/espower-typescript
86 stars 11 forks source link

import assert from 'assert' don't work with ts@2.6.2 #44

Closed zaaack closed 6 years ago

zaaack commented 6 years ago

error message:

assert_1.default is not a function 

Then I tried import assert from "power-assert", it worked, but no fancy power message.

Current workaround is const assert = require('assert')

teppeis commented 6 years ago

@zaaack import assert from 'assert' throws the error. It's by design of TypeScript and Node.js. Use import * as assert from 'assert' or const assert = require('assert').