pouchdb-community / pouchdb-authentication

User authentication plugin for PouchDB and CouchDB.
Apache License 2.0
777 stars 117 forks source link

* [bug] no default import on ts-es6 #237

Closed snowyu closed 6 years ago

snowyu commented 6 years ago

When imported it does not compile and gives me this error.

import AuthPlugin from 'pouchdb-authentication';

TS1192: Module '"/node_modules/pouchdb-authentication"' has no default export.

if you have export = module witch is our case and this breaks es6 style syntax See Microsoft/TypeScript#2242.

ptitjes commented 6 years ago

@snowyu Hi. Thanks for the PR.

Do you have the allowSyntheticDefaultImports compiler option set as specified in the PouchDB documentation ? [1]

In your tsconfig.json file, this should read:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true
  }
}

[1] https://pouchdb.com/guides/setup-pouchdb.html#typescript

snowyu commented 6 years ago

aha, Yes.