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

Dexie module does not have named export #1127

Closed
nicolashenry opened this issue Sep 25, 2020 · 2 comments
Closed

Dexie module does not have named export #1127

nicolashenry opened this issue Sep 25, 2020 · 2 comments

Comments

@nicolashenry
Copy link
Contributor

Hello,

The Dexie typescript definition file indicates that Dexie is exported as the default export and as 'Dexie' named export but the real javascript module only expose it as the default export.

So this:

import { Dexie } from 'Dexie';

causes this error while bundling:

export 'Dexie' was not found in 'dexie'

but typescript is not complaining.

@dfahlander
Copy link
Collaborator

Ok. I thought I did it in dexie-static-props.ts but I understand now that it only works for the umd version.

@dfahlander
Copy link
Collaborator

If we'd export {Dexie} together with export default Dexie in index.ts we create problems for rollup to generate the UMD version. For UMD outputs, rollup handles the case when only a default export is used so it is similar to module.exports = Dexie. Having a mixed export would require the UMD to let the final exported module become {Dexie: Dexie, default: Dexie}, which works bad for UMD exports.

I think it's fixable if we separate the UMD and ES builds a bit (different module entries and different rollup configs).
Working on it.

dfahlander added a commit that referenced this issue Sep 25, 2020
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

No branches or pull requests

2 participants