Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

snowyu
Copy link

@snowyu snowyu commented May 14, 2018

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
Copy link
Collaborator

ptitjes commented May 14, 2018

@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
Copy link
Author

snowyu commented May 14, 2018

aha, Yes.

@snowyu snowyu closed this May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants